skillfit 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -14
- package/README.zh-CN.md +48 -14
- package/benches/README.md +23 -0
- package/benches/contrib/README.md +1 -0
- package/benches/contrib/oss-skill-independent/README.md +60 -0
- package/benches/contrib/oss-skill-independent/bench.json +79 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/Readme.md +1015 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/esm.mjs +15 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/index.js +27 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/argument.js +147 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/command.js +1944 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/error.js +45 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/help.js +396 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/option.js +208 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/suggestSimilar.js +100 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package.json +63 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.d.ts +774 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.test-d.ts +416 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/upstream-package.json +69 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/Readme.md +1149 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/esm.mjs +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/index.js +24 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/argument.js +149 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/command.js +2662 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/error.js +39 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/help.js +713 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/option.js +367 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/suggestSimilar.js +101 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package.json +71 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/esm.d.mts +3 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.d.ts +1045 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.test-d.ts +737 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/upstream-package.json +82 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.d.ts +40 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.js +68 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/package.json +54 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/readme.md +99 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/upstream-package.json +54 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/index.js +67 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/package.json +46 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.js +132 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/package.json +57 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/readme.md +181 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/upstream-package.json +58 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.js +116 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/package.json +60 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/readme.md +170 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/upstream-package.json +60 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.d.ts +149 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.js +93 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/package.json +52 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/readme.md +192 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/upstream-package.json +52 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.js +114 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/readme.md +158 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/upstream-package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.js +122 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/package.json +50 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/readme.md +190 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/upstream-package.json +50 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/Readme.md +1015 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/esm.mjs +15 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/index.js +27 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/argument.js +147 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/command.js +1948 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/error.js +45 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/help.js +396 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/option.js +208 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/suggestSimilar.js +100 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package.json +63 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.d.ts +774 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.test-d.ts +416 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/upstream-package.json +69 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/Readme.md +1149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/esm.mjs +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/index.js +24 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/argument.js +149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/command.js +2666 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/error.js +39 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/help.js +713 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/option.js +367 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/suggestSimilar.js +101 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package.json +71 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/esm.d.mts +3 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.d.ts +1045 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.test-d.ts +737 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/upstream-package.json +82 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/async-hooks-stub.js +15 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.d.ts +40 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.js +71 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/package.json +61 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/readme.md +99 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/regression.test.mjs +6 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/upstream-package.json +54 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/index.js +67 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/package.json +46 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.js +148 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/package.json +57 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/readme.md +181 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/upstream-package.json +58 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-async-listener-order.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-output-isolation.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-async-context.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-map-iteration-rejection.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-throttle-sync-throw.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-custom-timers.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-infinity-abort.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-rejection-listener.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.js +121 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/package.json +60 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/readme.md +170 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/regression.test.mjs +6 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/upstream-package.json +60 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.d.ts +149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.js +95 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/package.json +52 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/readme.md +192 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/upstream-package.json +52 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.js +114 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/readme.md +158 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/upstream-package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.js +122 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/package.json +50 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/readme.md +190 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/upstream-package.json +50 -0
- package/benches/contrib/oss-skill-independent/prompts/commander-async-listener-order.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/commander-output-isolation.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/limit-async-context.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/limit-map-iteration-rejection.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/throttle-sync-throw.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-custom-timers.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-infinity-abort.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-rejection-listener.md +3 -0
- package/benches/contrib/oss-skill-independent/provenance.json +1903 -0
- package/benches/contrib/oss-skill-independent/task-specs.json +63 -0
- package/benches/contrib/oss-skill-independent/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/verifiers/cases.mjs +197 -0
- package/benches/contrib/oss-skill-independent/verifiers/commander-async-listener-order.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/commander-output-isolation.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/grade.mjs +48 -0
- package/benches/contrib/oss-skill-independent/verifiers/limit-async-context.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/limit-map-iteration-rejection.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/probe.mjs +16 -0
- package/benches/contrib/oss-skill-independent/verifiers/regression-evidence.mjs +105 -0
- package/benches/contrib/oss-skill-independent/verifiers/test-reporter.mjs +29 -0
- package/benches/contrib/oss-skill-independent/verifiers/throttle-sync-throw.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-custom-timers.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-infinity-abort.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-rejection-listener.mjs +1 -0
- package/dist/cli.js +183 -64
- package/dist/commands/bench-check-json.test.js +221 -0
- package/dist/commands/bench-check-report.js +48 -0
- package/dist/commands/bench-command-template.js +129 -0
- package/dist/commands/bench-manage.js +91 -0
- package/dist/commands/bench-manage.test.js +87 -0
- package/dist/commands/bench.js +166 -128
- package/dist/commands/bench.test.js +101 -0
- package/dist/commands/eval-component.js +25 -1
- package/dist/commands/eval-export.js +178 -0
- package/dist/commands/eval-export.test.js +279 -0
- package/dist/commands/eval-interruption.test.js +238 -0
- package/dist/commands/eval-preflight.js +61 -0
- package/dist/commands/eval-preflight.test.js +239 -0
- package/dist/commands/eval-report.js +44 -13
- package/dist/commands/eval-report.test.js +2 -2
- package/dist/commands/eval.js +94 -61
- package/dist/commands/eval.test.js +58 -1
- package/dist/harness/bench.js +21 -2
- package/dist/harness/eval-audit.js +45 -5
- package/dist/harness/eval-budget.js +51 -0
- package/dist/harness/eval-budget.test.js +212 -0
- package/dist/harness/eval-component.test.js +36 -0
- package/dist/harness/eval-contract.js +5 -1
- package/dist/harness/executors/api.js +10 -1
- package/dist/harness/executors/api.test.js +43 -0
- package/dist/harness/executors/cli.js +24 -3
- package/dist/harness/experiment-session.js +60 -9
- package/dist/harness/experiment-session.test.js +43 -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/replay-package.js +85 -0
- package/dist/harness/runner.js +74 -15
- package/dist/harness/trigger.js +20 -4
- package/docs/bench-authoring.md +40 -0
- package/docs/bench-check-json.md +122 -0
- package/docs/case-management.md +65 -0
- package/docs/eval-case-preflight.md +110 -0
- package/docs/eval-component.md +88 -49
- package/docs/eval-costs.md +9 -0
- package/docs/evaluation-input-snapshots.md +124 -0
- package/docs/evaluation-interruption.md +89 -0
- package/docs/evaluation-reports.md +49 -0
- package/docs/examples/check-receiver-mechanism-proposal.mjs +124 -0
- package/docs/examples/prepare-native-diff-probe.mjs +75 -0
- package/docs/examples/reproduce-independent-comparison-budget.mjs +73 -0
- package/docs/experiment-workflow.md +9 -2
- package/docs/first-real-eval.md +10 -1
- package/docs/growth-roadmap-2026-10.md +62 -93
- package/docs/metrics.md +52 -0
- package/docs/plans/2026-10-14-evidence-and-release-sequence.md +29 -12
- package/docs/plans/2026-10-15-independent-comparison-budget.json +1769 -0
- package/docs/plans/2026-10-15-independent-comparison-inputs.json +373 -0
- package/docs/plans/2026-10-15-independent-comparison-proposal.md +177 -0
- package/docs/plans/2026-10-15-native-diff-mechanism.md +105 -0
- package/docs/plans/2026-10-15-receiver-mechanism-proposal.json +342 -0
- package/docs/plans/2026-10-15-receiver-mechanism-proposal.md +146 -0
- package/docs/plans/2026-10-15-receiver-mechanism-verification.json +105 -0
- package/docs/plans/2026-10-16-case-workflow-and-release.md +49 -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 +81 -0
- package/docs/releases/0.10.1-feature-smoke.mjs +95 -0
- package/docs/releases/0.10.1.md +38 -0
- package/docs/releases/0.9.1-first-publication.json +249 -0
- package/docs/releases/0.9.1-verification.json +122 -0
- package/docs/releases/0.9.1.md +33 -1
- package/docs/releases/trusted-publishing.md +61 -0
- package/docs/replay-packages.md +97 -0
- package/docs/schemas/bench-check.schema.json +109 -0
- package/docs/schemas/eval-preflight.schema.json +57 -0
- package/docs/schemas/eval-request.schema.json +12 -0
- package/docs/schemas/eval-result.schema.json +11 -0
- package/docs/sharing-results.md +11 -2
- package/docs/skill-evaluation-evidence.md +52 -0
- package/evidence/2026-10-15-diagnosing-receiver-correction.md +140 -0
- package/evidence/2026-10-15-independent-comparison-regression-stop.md +162 -0
- package/evidence/2026-10-15-independent-offline-readiness.md +144 -0
- package/evidence/2026-10-15-native-diff-mechanism.md +196 -0
- package/evidence/2026-10-15-receiver-mechanism-stop.md +154 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/README.md +35 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/expected.json +577 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/receiver-contract.test.mjs +138 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/replay.mjs +127 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/verification.json +105 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/README.md +32 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/checks.json +32 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/verification.json +25 -0
- package/evidence/artifacts/2026-10-15-independent-offline-readiness/README.md +17 -0
- package/evidence/artifacts/2026-10-15-independent-offline-readiness/verification.json +1548 -0
- package/evidence/artifacts/2026-10-15-native-diff-mechanism/README.md +48 -0
- package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/README.md +38 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/checks.json +118 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/verification.json +36 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/LICENSE +21 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/SKILL.md +51 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/agents/openai.yaml +3 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/scripts/hitl-loop.template.sh +44 -0
- package/package.json +1 -1
- package/skills/skillfit/SKILL.md +17 -5
package/dist/commands/bench.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSyn
|
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
5
5
|
import { getAgent } from '../agents.js';
|
|
6
|
-
import { loadBench } from '../harness/bench.js';
|
|
6
|
+
import { loadBench, selectBenchTasks } from '../harness/bench.js';
|
|
7
7
|
import { ExperimentSession, validateCallBudget } from '../harness/experiment-session.js';
|
|
8
8
|
import { CliExecutor } from '../harness/executors/cli.js';
|
|
9
9
|
import { listFilesRecursive } from '../harness/hash.js';
|
|
@@ -12,7 +12,10 @@ import { runTrial, runVerifier, verifierFailure } from '../harness/runner.js';
|
|
|
12
12
|
import { MOCK_MARKER_FILE, RUN_GROUP_PATTERN } from '../harness/constants.js';
|
|
13
13
|
import { verdictFromOutput } from '../harness/verifier-summary.js';
|
|
14
14
|
import { confirm as confirmPrompt } from './confirm.js';
|
|
15
|
+
import { commandTemplateFiles } from './bench-command-template.js';
|
|
16
|
+
import { benchDiagnostic, benchCheckEvidence } from './bench-check-report.js';
|
|
15
17
|
import { BACKUP_SUFFIX } from './install.js';
|
|
18
|
+
import { withEvaluationInterrupts, throwIfEvaluationInterrupted } from '../harness/interruption.js';
|
|
16
19
|
const FIXTURE_SIZE_WARN_BYTES = 64 * 1024;
|
|
17
20
|
// benches/README.md: a verifier decomposes its acceptance criteria into 2–8 named checks.
|
|
18
21
|
const MIN_FACET_CHECKS = 2;
|
|
@@ -101,8 +104,12 @@ a real task from your own work:
|
|
|
101
104
|
}
|
|
102
105
|
export async function runBenchInit(options) {
|
|
103
106
|
const log = options.log ?? ((msg) => console.log(msg));
|
|
107
|
+
const kind = options.kind ?? 'output';
|
|
108
|
+
if (kind !== 'output' && kind !== 'command') {
|
|
109
|
+
throw new Error(`Unknown bench kind: ${kind} (expected "output" or "command")`);
|
|
110
|
+
}
|
|
104
111
|
const dir = resolve(options.cwd ?? process.cwd(), options.dir ?? 'skillfit-bench');
|
|
105
|
-
const files = templateFiles(basename(dir));
|
|
112
|
+
const files = kind === 'command' ? commandTemplateFiles(basename(dir)) : templateFiles(basename(dir));
|
|
106
113
|
const created = Object.keys(files);
|
|
107
114
|
if (options.dryRun) {
|
|
108
115
|
log(`Bench scaffold plan (dry run) — ${dir}:`);
|
|
@@ -131,7 +138,8 @@ export async function runBenchInit(options) {
|
|
|
131
138
|
log(`Bench scaffolded at ${dir} (${created.length} files, self-check passed).`);
|
|
132
139
|
log('Next:');
|
|
133
140
|
log(` skillfit bench check ${dir}`);
|
|
134
|
-
log(` skillfit eval <skill-path> --bench ${dir} --agent <id
|
|
141
|
+
log(` skillfit eval <skill-path> --bench ${dir} --agent <id>${kind === 'command' ? ' --input workspace' : ''} --trials 1 --max-calls 2 --dry-run`);
|
|
142
|
+
log('This is a teaching case. Replace it with your own task before measuring Skill benefit.');
|
|
135
143
|
return { dir, created };
|
|
136
144
|
}
|
|
137
145
|
async function probeVerifier(benchDir, verifier, output) {
|
|
@@ -144,6 +152,7 @@ async function probeVerifier(benchDir, verifier, output) {
|
|
|
144
152
|
return {
|
|
145
153
|
exitCode: result.exitCode,
|
|
146
154
|
error: result.error,
|
|
155
|
+
output: result.output,
|
|
147
156
|
checks: verdictFromOutput(result.output)?.checks ?? null,
|
|
148
157
|
};
|
|
149
158
|
}
|
|
@@ -184,6 +193,8 @@ async function runOracleGate(benchDir, fixtureDir, oracle, verifier) {
|
|
|
184
193
|
if (oracleRun.exitCode !== 0) {
|
|
185
194
|
return {
|
|
186
195
|
kind: 'oracle-failed',
|
|
196
|
+
result: oracleRun,
|
|
197
|
+
command: oracle,
|
|
187
198
|
exitCode: oracleRun.exitCode,
|
|
188
199
|
reason: oracleRun.exitCode === null ? verifierFailure('oracle', oracle, oracleRun.error) : null,
|
|
189
200
|
};
|
|
@@ -192,14 +203,16 @@ async function runOracleGate(benchDir, fixtureDir, oracle, verifier) {
|
|
|
192
203
|
if (graded.exitCode !== 0) {
|
|
193
204
|
return {
|
|
194
205
|
kind: 'verifier-failed',
|
|
206
|
+
result: graded,
|
|
207
|
+
command: verifier,
|
|
195
208
|
reason: graded.exitCode === null ? verifierFailure('verifier', verifier, graded.error) : null,
|
|
196
209
|
};
|
|
197
210
|
}
|
|
198
211
|
const score = verdictFromOutput(graded.output)?.score ?? null;
|
|
199
212
|
if (score !== null && score < 1) {
|
|
200
|
-
return { kind: 'low-score', score };
|
|
213
|
+
return { kind: 'low-score', score, result: graded, command: verifier };
|
|
201
214
|
}
|
|
202
|
-
return { kind: 'pass', score };
|
|
215
|
+
return { kind: 'pass', score, result: graded, command: verifier };
|
|
203
216
|
}
|
|
204
217
|
finally {
|
|
205
218
|
rmSync(dir, { recursive: true, force: true });
|
|
@@ -211,22 +224,26 @@ async function probeOracle(benchDir, fixture, oracle, verifier) {
|
|
|
211
224
|
case 'oracle-failed':
|
|
212
225
|
return {
|
|
213
226
|
status: 'FAIL',
|
|
227
|
+
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
214
228
|
message: gate.reason ??
|
|
215
229
|
`oracle command itself failed (exit ${gate.exitCode}) — the reference solution cannot run`,
|
|
216
230
|
};
|
|
217
231
|
case 'verifier-failed':
|
|
218
232
|
return {
|
|
219
233
|
status: 'FAIL',
|
|
234
|
+
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
220
235
|
message: gate.reason ?? 'oracle solution does not pass the verifier — the task is unwinnable or the oracle is stale',
|
|
221
236
|
};
|
|
222
237
|
case 'low-score':
|
|
223
238
|
return {
|
|
224
239
|
status: 'FAIL',
|
|
240
|
+
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
225
241
|
message: `oracle passes the verifier but scores ${gate.score.toFixed(2)} on its checks — the checks are stricter than the exit code`,
|
|
226
242
|
};
|
|
227
243
|
case 'pass':
|
|
228
244
|
return {
|
|
229
245
|
status: 'PASS',
|
|
246
|
+
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
230
247
|
message: `oracle solution passes the verifier${gate.score !== null ? ' with full checks' : ''}`,
|
|
231
248
|
};
|
|
232
249
|
}
|
|
@@ -238,19 +255,22 @@ export async function runBenchCheck(options) {
|
|
|
238
255
|
const log = options.log ?? ((msg) => console.log(msg));
|
|
239
256
|
const dir = resolve(options.dir ?? '.');
|
|
240
257
|
const checks = [];
|
|
241
|
-
|
|
242
|
-
|
|
258
|
+
let identity = null;
|
|
259
|
+
const push = (code, status, message, task, evidence) => {
|
|
260
|
+
throwIfEvaluationInterrupted();
|
|
261
|
+
checks.push(benchDiagnostic(code, status, message, task, evidence));
|
|
243
262
|
log(renderCheck({ status, message }));
|
|
244
263
|
};
|
|
245
264
|
let bench;
|
|
246
265
|
try {
|
|
247
|
-
bench = loadBench(dir);
|
|
266
|
+
bench = selectBenchTasks(loadBench(dir), options.taskIds);
|
|
248
267
|
}
|
|
249
268
|
catch (error) {
|
|
250
|
-
push('FAIL', `bench does not load: ${error.message}`);
|
|
251
|
-
return finish(dir, checks, log);
|
|
269
|
+
push('BENCH_LOAD', 'FAIL', `bench does not load: ${error.message}`);
|
|
270
|
+
return finish(dir, checks, log, false, identity);
|
|
252
271
|
}
|
|
253
|
-
|
|
272
|
+
identity = { name: bench.name, sha256: bench.contentSha256, taskCount: bench.tasks.length };
|
|
273
|
+
push('BENCH_LOAD', 'PASS', `bench.json valid (${bench.tasks.length} task(s), content sha256 ${bench.contentSha256.slice(0, 12)}…)`);
|
|
254
274
|
if (options.calibrate) {
|
|
255
275
|
const trials = options.calibrate.trials ?? CALIBRATE_DEFAULT_TRIALS;
|
|
256
276
|
if (!Number.isInteger(trials) || trials < 1 || trials > 20)
|
|
@@ -260,6 +280,7 @@ export async function runBenchCheck(options) {
|
|
|
260
280
|
let labeledTasks = 0;
|
|
261
281
|
let negativeTasks = 0;
|
|
262
282
|
for (const task of bench.tasks) {
|
|
283
|
+
const taskPush = (code, status, message, evidence) => push(code, status, message, task, evidence);
|
|
263
284
|
let facetChecks = null;
|
|
264
285
|
if ((task.verifierKind ?? 'output') === 'command') {
|
|
265
286
|
const fixtureCopy = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
|
|
@@ -270,13 +291,13 @@ export async function runBenchCheck(options) {
|
|
|
270
291
|
if (pristine.exitCode === null) {
|
|
271
292
|
// Without this branch a verifier that cannot even be spawned reads as a clean NOP gate:
|
|
272
293
|
// "fails on the untouched fixture" is exactly what `exitCode !== 0` looks like.
|
|
273
|
-
|
|
294
|
+
taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, pristine.error)}`, benchCheckEvidence(pristine, task.verifier));
|
|
274
295
|
}
|
|
275
296
|
else if (pristine.exitCode === 0) {
|
|
276
|
-
|
|
297
|
+
taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: command verifier already passes on the untouched fixture — the task is solved or the verifier is broken`, benchCheckEvidence(pristine, task.verifier));
|
|
277
298
|
}
|
|
278
299
|
else {
|
|
279
|
-
|
|
300
|
+
taskPush('UNTOUCHED_FIXTURE', 'PASS', `${task.id}: command verifier fails on the untouched fixture (the failure reproduces)`, benchCheckEvidence(pristine, task.verifier));
|
|
280
301
|
}
|
|
281
302
|
}
|
|
282
303
|
finally {
|
|
@@ -286,39 +307,39 @@ export async function runBenchCheck(options) {
|
|
|
286
307
|
else {
|
|
287
308
|
const missing = await probeVerifier(bench.dir, task.verifier, null);
|
|
288
309
|
if (missing.exitCode === null) {
|
|
289
|
-
|
|
310
|
+
taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, missing.error)}`, benchCheckEvidence(missing, task.verifier));
|
|
290
311
|
}
|
|
291
312
|
else if (missing.exitCode === 0) {
|
|
292
|
-
|
|
313
|
+
taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: verifier does not reject a missing _output.md`, benchCheckEvidence(missing, task.verifier));
|
|
293
314
|
}
|
|
294
315
|
else {
|
|
295
|
-
|
|
316
|
+
taskPush('MISSING_OUTPUT', 'PASS', `${task.id}: verifier rejects missing output`, benchCheckEvidence(missing, task.verifier));
|
|
296
317
|
}
|
|
297
318
|
const empty = await probeVerifier(bench.dir, task.verifier, '');
|
|
298
319
|
facetChecks = empty.checks;
|
|
299
320
|
if (empty.exitCode === null) {
|
|
300
|
-
|
|
321
|
+
taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, empty.error)}`, benchCheckEvidence(empty, task.verifier));
|
|
301
322
|
}
|
|
302
323
|
else if (empty.exitCode === 0) {
|
|
303
|
-
|
|
324
|
+
taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: verifier passes an empty output — it cannot tell success from silence`, benchCheckEvidence(empty, task.verifier));
|
|
304
325
|
}
|
|
305
326
|
else {
|
|
306
|
-
|
|
327
|
+
taskPush('EMPTY_OUTPUT', 'PASS', `${task.id}: verifier rejects empty output`, benchCheckEvidence(empty, task.verifier));
|
|
307
328
|
}
|
|
308
329
|
}
|
|
309
330
|
const facetGate = facetCountCheck(task.id, facetChecks);
|
|
310
331
|
if (facetGate)
|
|
311
|
-
|
|
332
|
+
taskPush('FACET_COUNT', facetGate.status, facetGate.message);
|
|
312
333
|
if (task.oracle) {
|
|
313
334
|
const oracleResult = await probeOracle(bench.dir, task.fixture, task.oracle, task.verifier);
|
|
314
|
-
|
|
335
|
+
taskPush('ORACLE', oracleResult.status, `${task.id}: ${oracleResult.message}`, oracleResult.evidence);
|
|
315
336
|
}
|
|
316
337
|
else {
|
|
317
|
-
|
|
338
|
+
taskPush('ORACLE', 'WARN', `${task.id}: no oracle — task winnability is unverified (nothing proves a correct solution passes this verifier; register one with --oracle or write ground-truth/oracle-${task.id}.mjs)`);
|
|
318
339
|
}
|
|
319
340
|
const markerPath = join(bench.dir, task.fixture, MOCK_MARKER_FILE);
|
|
320
341
|
if ((task.verifierKind ?? 'output') === 'command') {
|
|
321
|
-
|
|
342
|
+
taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: command verifier — mock-arm probes not applicable (a mock writes _output.md text, not file edits)${task.oracle
|
|
322
343
|
? '; offline coverage comes from the oracle and NOP gates above'
|
|
323
344
|
: '; with no oracle registered, nothing offline shows this task is solvable'}`);
|
|
324
345
|
}
|
|
@@ -327,31 +348,34 @@ export async function runBenchCheck(options) {
|
|
|
327
348
|
const marker = JSON.parse(readFileSync(markerPath, 'utf8'));
|
|
328
349
|
for (const arm of ['baseline', 'treatment']) {
|
|
329
350
|
const behavior = marker[arm];
|
|
330
|
-
if (behavior?.output === undefined)
|
|
351
|
+
if (behavior?.output === undefined) {
|
|
352
|
+
taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', 'INFO', `${task.id}: no mock ${arm} output — this arm was not probed`);
|
|
331
353
|
continue;
|
|
354
|
+
}
|
|
332
355
|
const probe = await probeVerifier(bench.dir, task.verifier, behavior.output);
|
|
333
|
-
|
|
356
|
+
taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', probe.exitCode === null ? 'FAIL' : 'INFO', `${task.id}: mock ${arm} output → ${probe.exitCode === null ? verifierFailure('verifier', task.verifier, probe.error) : `verifier ${probe.exitCode === 0 ? 'pass' : 'fail'}`}`, benchCheckEvidence(probe, task.verifier));
|
|
334
357
|
}
|
|
335
358
|
}
|
|
336
359
|
catch (error) {
|
|
337
|
-
|
|
360
|
+
throwIfEvaluationInterrupted();
|
|
361
|
+
taskPush('MOCK_MARKER', 'FAIL', `${task.id}: ${MOCK_MARKER_FILE} is unreadable (${error.message})`);
|
|
338
362
|
}
|
|
339
363
|
}
|
|
340
364
|
else {
|
|
341
|
-
|
|
365
|
+
taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: no ${MOCK_MARKER_FILE} (offline mock runs will produce empty outputs)`);
|
|
342
366
|
}
|
|
343
367
|
const fixtureDir = join(bench.dir, task.fixture);
|
|
344
368
|
const fixtureBytes = listFilesRecursive(fixtureDir)
|
|
345
369
|
.map((rel) => statSync(join(fixtureDir, rel)).size)
|
|
346
370
|
.reduce((sum, size) => sum + size, 0);
|
|
347
371
|
if (fixtureBytes > FIXTURE_SIZE_WARN_BYTES) {
|
|
348
|
-
|
|
372
|
+
taskPush('FIXTURE_SIZE', 'WARN', `${task.id}: fixture is ${Math.round(fixtureBytes / 1024)} KB — inject mode inlines it into every prompt; keep it lean`);
|
|
349
373
|
}
|
|
350
374
|
else {
|
|
351
|
-
|
|
375
|
+
taskPush('FIXTURE_SIZE', 'PASS', `${task.id}: fixture size ${Math.round(fixtureBytes / 1024)} KB`);
|
|
352
376
|
}
|
|
353
377
|
if (task.shouldTrigger === undefined) {
|
|
354
|
-
|
|
378
|
+
taskPush('TRIGGER_LABEL', 'INFO', `${task.id}: no shouldTrigger label (trigger mode will skip this task)`);
|
|
355
379
|
}
|
|
356
380
|
else {
|
|
357
381
|
labeledTasks++;
|
|
@@ -363,19 +387,19 @@ export async function runBenchCheck(options) {
|
|
|
363
387
|
const fraction = negativeTasks / labeledTasks;
|
|
364
388
|
const percent = Math.round(fraction * 100);
|
|
365
389
|
if (negativeTasks === 0) {
|
|
366
|
-
push('WARN', 'no shouldTrigger:false (negative-control) tasks — trigger mode cannot measure false-trigger rate (see docs/metrics.md)');
|
|
390
|
+
push('NEGATIVE_CONTROLS', 'WARN', 'no shouldTrigger:false (negative-control) tasks — trigger mode cannot measure false-trigger rate (see docs/metrics.md)');
|
|
367
391
|
}
|
|
368
392
|
else if (fraction < NEGATIVE_CONTROL_TARGET) {
|
|
369
|
-
push('WARN', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — below the ${NEGATIVE_CONTROL_PERCENT}% target in docs/metrics.md, so false-trigger rate rests on a thin sample`);
|
|
393
|
+
push('NEGATIVE_CONTROLS', 'WARN', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — below the ${NEGATIVE_CONTROL_PERCENT}% target in docs/metrics.md, so false-trigger rate rests on a thin sample`);
|
|
370
394
|
}
|
|
371
395
|
else {
|
|
372
|
-
push('PASS', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — at or above the ${NEGATIVE_CONTROL_PERCENT}% target`);
|
|
396
|
+
push('NEGATIVE_CONTROLS', 'PASS', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — at or above the ${NEGATIVE_CONTROL_PERCENT}% target`);
|
|
373
397
|
}
|
|
374
398
|
}
|
|
375
399
|
if (options.calibrate) {
|
|
376
|
-
await calibrateBench(bench, options.calibrate, push, log);
|
|
400
|
+
await calibrateBench(bench, options.calibrate, (status, message) => push('CALIBRATION', status, message), log);
|
|
377
401
|
}
|
|
378
|
-
return finish(dir, checks, log, options.calibrate !== false && options.calibrate !== undefined);
|
|
402
|
+
return finish(dir, checks, log, options.calibrate !== false && options.calibrate !== undefined, identity);
|
|
379
403
|
}
|
|
380
404
|
const CALIBRATE_DEFAULT_TRIALS = 2;
|
|
381
405
|
async function calibrateBench(bench, options, push, log) {
|
|
@@ -398,101 +422,104 @@ async function calibrateBench(bench, options, push, log) {
|
|
|
398
422
|
push('INFO', `calibration plan: ${bench.tasks.length} task(s) × ${trials} baseline run(s), input ${inputMode}; ${plannedCalls} calls, ceiling ${maxCalls}; no agent started and no run directory created`);
|
|
399
423
|
return;
|
|
400
424
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
425
|
+
return withEvaluationInterrupts(async () => {
|
|
426
|
+
const emptySkillDir = mkdtempSync(join(tmpdir(), 'skillfit-calibrate-'));
|
|
427
|
+
let session;
|
|
428
|
+
let failure;
|
|
429
|
+
try {
|
|
430
|
+
const skill = {
|
|
431
|
+
kind: 'skill',
|
|
432
|
+
name: 'calibration-none',
|
|
433
|
+
sourceDir: emptySkillDir,
|
|
434
|
+
files: [],
|
|
435
|
+
sha256: '0'.repeat(64),
|
|
436
|
+
payload: '',
|
|
437
|
+
overlays: {},
|
|
438
|
+
};
|
|
439
|
+
const runGroup = options.runGroup ??
|
|
440
|
+
`calibrate-${new Date().toISOString().slice(0, 10).replaceAll('-', '')}-${String(Date.now() % 100000).padStart(5, '0')}`;
|
|
441
|
+
if (!RUN_GROUP_PATTERN.test(runGroup))
|
|
442
|
+
throw new Error(`Invalid run group: ${runGroup}`);
|
|
443
|
+
const runsRoot = options.runsRoot ?? resolve('runs');
|
|
444
|
+
push('INFO', `calibration plan: ${plannedCalls} baseline calls, ceiling ${maxCalls}; fresh output ${join(runsRoot, runGroup)}`);
|
|
445
|
+
session = new ExperimentSession({ bench, target: skill, groupDir: join(runsRoot, runGroup), plannedCalls,
|
|
446
|
+
maxCalls, agent: options.agent, injected: options.executor !== undefined, ...options.sessionOptions,
|
|
447
|
+
workspaces: bench.tasks.flatMap(task => Array.from({ length: trials }, (_, i) => join(runsRoot, runGroup, task.id, 'baseline', `trial-${i + 1}`))),
|
|
448
|
+
details: { mode: 'calibration', inputMode, trials, executor: executor.describe() } });
|
|
449
|
+
// Calibration measures inject-mode baseline difficulty, so it drives the inject path with an
|
|
450
|
+
// empty skill payload (prompt.ts drops a falsy payload, so no skill block is injected) and runs
|
|
451
|
+
// one arm per task. This used to route through trigger mode, whose `shouldTrigger` filter
|
|
452
|
+
// silently calibrated zero tasks on an unlabelled bench and then reported PASS 0/0.
|
|
453
|
+
const plan = {
|
|
454
|
+
bench,
|
|
455
|
+
target: skill,
|
|
456
|
+
inputMode,
|
|
457
|
+
executor: session.wrap(executor, 'agent'),
|
|
458
|
+
trials,
|
|
459
|
+
runsRoot,
|
|
460
|
+
runGroup,
|
|
461
|
+
log,
|
|
462
|
+
};
|
|
463
|
+
push('INFO', `calibration: ${trials} run(s) per task with no skill installed (baseline difficulty; input ${inputMode})`);
|
|
464
|
+
let discriminative = 0;
|
|
465
|
+
let tasksRun = 0;
|
|
466
|
+
const taskResults = [];
|
|
467
|
+
for (const task of bench.tasks) {
|
|
468
|
+
let passes = 0;
|
|
469
|
+
let completed = 0;
|
|
470
|
+
let errors = 0;
|
|
471
|
+
for (let trial = 1; trial <= trials; trial++) {
|
|
472
|
+
const outcome = await runTrial(plan, task.id, 'baseline', trial);
|
|
473
|
+
throwIfEvaluationInterrupted();
|
|
474
|
+
if (outcome.error !== null) {
|
|
475
|
+
errors++;
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
completed++;
|
|
479
|
+
if (outcome.passed)
|
|
480
|
+
passes++;
|
|
481
|
+
}
|
|
482
|
+
taskResults.push({ id: task.id, passes, completed, errors });
|
|
483
|
+
if (completed === 0) {
|
|
484
|
+
push('WARN', `${task.id}: no completed runs${errors > 0 ? ` (${errors} ungraded run(s))` : ''} — cannot assess difficulty`);
|
|
450
485
|
continue;
|
|
451
486
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
push('WARN', `${task.id}: baseline ${passes}/${completed} — too easy (saturated; cannot discriminate skill effects)`);
|
|
465
|
-
}
|
|
466
|
-
else if (rate <= 0.1) {
|
|
467
|
-
push('WARN', `${task.id}: baseline ${passes}/${completed} — too hard or broken (floor)`);
|
|
487
|
+
tasksRun++;
|
|
488
|
+
const rate = passes / completed;
|
|
489
|
+
if (rate >= 0.9) {
|
|
490
|
+
push('WARN', `${task.id}: baseline ${passes}/${completed} — too easy (saturated; cannot discriminate skill effects)`);
|
|
491
|
+
}
|
|
492
|
+
else if (rate <= 0.1) {
|
|
493
|
+
push('WARN', `${task.id}: baseline ${passes}/${completed} — too hard or broken (floor)`);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
discriminative++;
|
|
497
|
+
push('PASS', `${task.id}: baseline ${passes}/${completed} — discriminative band`);
|
|
498
|
+
}
|
|
468
499
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
500
|
+
session.settle();
|
|
501
|
+
const result = { schemaVersion: 1, runGroup, inputMode, trials, tasks: taskResults, experiment: session.summary() };
|
|
502
|
+
writeFileSync(join(session.groupDir, '_calibration.json'), JSON.stringify(result, null, 2) + '\n', { flag: 'wx' });
|
|
503
|
+
session.finish(undefined, result, '_calibration.json');
|
|
504
|
+
if (session.summary().status !== 'completed')
|
|
505
|
+
push('FAIL', 'Calibration stopped or incomplete; inspect _session.json and _calls.jsonl before a fresh plan.');
|
|
506
|
+
if (tasksRun === 0) {
|
|
507
|
+
push('FAIL', `calibration ran 0 task(s): difficulty unmeasured (runs under ${runGroup})`);
|
|
508
|
+
return;
|
|
472
509
|
}
|
|
510
|
+
push(discriminative === tasksRun ? 'PASS' : 'INFO', `calibration: ${discriminative}/${tasksRun} task(s) in the discriminative band (runs under ${runGroup}; use --trials 3+ for steadier reads)`);
|
|
473
511
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
session.finish(undefined, result, '_calibration.json');
|
|
478
|
-
if (session.summary().status !== 'completed')
|
|
479
|
-
push('FAIL', 'Calibration stopped or incomplete; inspect _session.json and _calls.jsonl before a fresh plan.');
|
|
480
|
-
if (tasksRun === 0) {
|
|
481
|
-
push('FAIL', `calibration ran 0 task(s): difficulty unmeasured (runs under ${runGroup})`);
|
|
482
|
-
return;
|
|
512
|
+
catch (error) {
|
|
513
|
+
failure = error;
|
|
514
|
+
throw error;
|
|
483
515
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
finally {
|
|
491
|
-
session?.finish(failure);
|
|
492
|
-
rmSync(emptySkillDir, { recursive: true, force: true });
|
|
493
|
-
}
|
|
516
|
+
finally {
|
|
517
|
+
session?.finish(failure);
|
|
518
|
+
rmSync(emptySkillDir, { recursive: true, force: true });
|
|
519
|
+
}
|
|
520
|
+
});
|
|
494
521
|
}
|
|
495
|
-
function finish(dir, checks, log, calibrated = false) {
|
|
522
|
+
function finish(dir, checks, log, calibrated = false, bench = null) {
|
|
496
523
|
const failures = checks.filter((c) => c.status === 'FAIL').length;
|
|
497
524
|
const warnings = checks.filter((c) => c.status === 'WARN').length;
|
|
498
525
|
const passes = checks.filter((c) => c.status === 'PASS').length;
|
|
@@ -503,7 +530,7 @@ function finish(dir, checks, log, calibrated = false) {
|
|
|
503
530
|
log(` skillfit eval <skill-path> --bench ${dir} --agent <id> --trials 5`);
|
|
504
531
|
log(' target: baseline pass rate 30–70%; --calibrate warns outside 10–90% (docs/metrics.md L0).');
|
|
505
532
|
}
|
|
506
|
-
return { dir, checks, failures, warnings };
|
|
533
|
+
return { dir, bench, checks, failures, warnings };
|
|
507
534
|
}
|
|
508
535
|
const TASK_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
509
536
|
export function captureSourceFiles(sourceDir) {
|
|
@@ -661,7 +688,7 @@ function assertInsideBench(benchDir, target) {
|
|
|
661
688
|
throw new Error(`Refusing to write outside the bench directory: ${target}`);
|
|
662
689
|
}
|
|
663
690
|
}
|
|
664
|
-
function applyBenchWrites(benchDir, writes) {
|
|
691
|
+
export function applyBenchWrites(benchDir, writes) {
|
|
665
692
|
const applied = [];
|
|
666
693
|
try {
|
|
667
694
|
for (const write of writes) {
|
|
@@ -676,8 +703,19 @@ function applyBenchWrites(benchDir, writes) {
|
|
|
676
703
|
throw new Error(`Refusing to overwrite a non-file: ${write.target}`);
|
|
677
704
|
previous = readFileSync(write.target);
|
|
678
705
|
const backup = write.target + BACKUP_SUFFIX;
|
|
679
|
-
|
|
680
|
-
|
|
706
|
+
let backupExists = false;
|
|
707
|
+
try {
|
|
708
|
+
const backupStat = lstatSync(backup);
|
|
709
|
+
if (backupStat.isSymbolicLink() || !backupStat.isFile())
|
|
710
|
+
throw new Error(`Refusing an unsafe backup target: ${backup}`);
|
|
711
|
+
backupExists = true;
|
|
712
|
+
}
|
|
713
|
+
catch (error) {
|
|
714
|
+
if (error.code !== 'ENOENT')
|
|
715
|
+
throw error;
|
|
716
|
+
}
|
|
717
|
+
if (!backupExists)
|
|
718
|
+
writeFileSync(backup, previous, { flag: 'wx' });
|
|
681
719
|
}
|
|
682
720
|
catch (error) {
|
|
683
721
|
if (error.code !== 'ENOENT')
|
|
@@ -7,6 +7,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { test } from 'node:test';
|
|
8
8
|
import { loadBench } from '../harness/bench.js';
|
|
9
9
|
import { runVerifier } from '../harness/runner.js';
|
|
10
|
+
import { parseVerifierSummary } from '../harness/verifier-summary.js';
|
|
10
11
|
import { runBenchAdd, runBenchCheck, runBenchInit } from './bench.js';
|
|
11
12
|
const PACKAGE_ROOT = fileURLToPath(new URL('../..', import.meta.url));
|
|
12
13
|
const BUNDLED_CODE_REVIEW = join(PACKAGE_ROOT, 'benches', 'code-review');
|
|
@@ -52,10 +53,110 @@ test('runBenchInit scaffolds a bench that loads and passes bench check', async (
|
|
|
52
53
|
const bench = loadBench(result.dir);
|
|
53
54
|
assert.equal(bench.name, 'skillfit-bench');
|
|
54
55
|
assert.equal(bench.tasks.length, 1);
|
|
56
|
+
assert.equal(bench.tasks[0]?.verifierKind, undefined, 'default output template is unchanged');
|
|
55
57
|
const report = await runBenchCheck({ dir: result.dir, log: () => { } });
|
|
56
58
|
assert.equal(report.failures, 0);
|
|
57
59
|
assert.ok(report.checks.some((c) => c.status === 'INFO' && c.message.includes('no shouldTrigger label')));
|
|
58
60
|
});
|
|
61
|
+
test('command starter dry-run writes nothing and invalid kinds fail before writing', async (t) => {
|
|
62
|
+
const cwd = tmp(t, 'skillfit-command-init-');
|
|
63
|
+
const { lines, log } = collector();
|
|
64
|
+
await runBenchInit({ cwd, kind: 'command', dryRun: true, log });
|
|
65
|
+
assert.ok(!existsSync(join(cwd, 'skillfit-bench')));
|
|
66
|
+
assert.match(lines.join('\n'), /fixtures\/example-task\/index\.js/);
|
|
67
|
+
await assert.rejects(() => runBenchInit({ cwd, kind: 'typo', yes: true, log }), /Unknown bench kind/);
|
|
68
|
+
assert.ok(!existsSync(join(cwd, 'skillfit-bench')));
|
|
69
|
+
});
|
|
70
|
+
test('command starter is self-contained, passes offline NOP/oracle gates and previews two calls', async (t) => {
|
|
71
|
+
const cwd = tmp(t, 'skillfit-command-init-');
|
|
72
|
+
const dir = join(cwd, 'my bench');
|
|
73
|
+
const { lines, log } = collector();
|
|
74
|
+
await runBenchInit({ dir, kind: 'command', yes: true, log });
|
|
75
|
+
const bench = loadBench(dir);
|
|
76
|
+
assert.equal(bench.tasks[0]?.verifierKind, 'command');
|
|
77
|
+
assert.equal(bench.tasks[0]?.promptTrigger, 'prompts/example-task.trigger.md');
|
|
78
|
+
const original = readFileSync(join(dir, 'fixtures/example-task/index.js'), 'utf8');
|
|
79
|
+
const report = await runBenchCheck({ dir, log: () => { } });
|
|
80
|
+
assert.equal(report.failures, 0, JSON.stringify(report.checks));
|
|
81
|
+
assert.equal(report.warnings, 0, JSON.stringify(report.checks));
|
|
82
|
+
assert.equal(readFileSync(join(dir, 'fixtures/example-task/index.js'), 'utf8'), original, 'offline check must solve only a disposable copy');
|
|
83
|
+
assert.match(lines.join('\n'), /--input workspace --trials 1 --max-calls 2 --dry-run/);
|
|
84
|
+
const preview = spawnSync(process.execPath, [join(PACKAGE_ROOT, 'dist/cli.js'),
|
|
85
|
+
'eval', join(PACKAGE_ROOT, 'skills/skillfit'), '--bench', dir, '--agent', 'codex',
|
|
86
|
+
'--input', 'workspace', '--trials', '1', '--max-calls', '2', '--dry-run'], { cwd, encoding: 'utf8', timeout: 30_000 });
|
|
87
|
+
assert.equal(preview.status, 0, preview.stderr);
|
|
88
|
+
assert.match(preview.stdout, /2 planned; ceiling 2/);
|
|
89
|
+
assert.match(preview.stdout, /workspace files on disk/);
|
|
90
|
+
assert.ok(!existsSync(join(cwd, 'runs')), 'preview must not create a run');
|
|
91
|
+
});
|
|
92
|
+
test('command starter grades behavior, accepting equivalent repairs and rejecting wrong or incomplete programs', async (t) => {
|
|
93
|
+
const cwd = tmp(t, 'skillfit-command-grade-');
|
|
94
|
+
const dir = join(cwd, 'bench');
|
|
95
|
+
await runBenchInit({ dir, kind: 'command', yes: true, log: () => { } });
|
|
96
|
+
const programs = [
|
|
97
|
+
{ id: 'original', source: 'export const add = (a, b) => a - b;', passed: false },
|
|
98
|
+
{ id: 'equivalent', source: 'export const add = (left, right) => [left, right].reduce((sum, n) => sum + n, 0);', passed: true },
|
|
99
|
+
{ id: 'hardcoded', source: 'export const add = () => 5;', passed: false },
|
|
100
|
+
{ id: 'partial', source: 'export const add = (a, b) => Math.abs(a + b);', passed: false },
|
|
101
|
+
{ id: 'syntax-error', source: 'export const add = ;', passed: false },
|
|
102
|
+
{ id: 'early-exit', source: 'process.exit(0);', passed: false },
|
|
103
|
+
];
|
|
104
|
+
for (const program of programs)
|
|
105
|
+
await t.test(program.id, async () => {
|
|
106
|
+
const runDir = join(cwd, `run ${program.id}`);
|
|
107
|
+
cpSync(join(dir, 'fixtures/example-task'), runDir, { recursive: true });
|
|
108
|
+
writeFileSync(join(runDir, 'index.js'), program.source);
|
|
109
|
+
const result = await runVerifier(dir, 'node verifiers/example-task.mjs', runDir);
|
|
110
|
+
assert.equal(result.exitCode, program.passed ? 0 : 1, result.output);
|
|
111
|
+
const summary = parseVerifierSummary(result.output);
|
|
112
|
+
assert.equal(summary?.passed, program.passed);
|
|
113
|
+
assert.equal(summary?.checks.length, 4);
|
|
114
|
+
assert.equal(summary?.checks[0]?.pass, true);
|
|
115
|
+
if (program.id === 'partial') {
|
|
116
|
+
assert.equal(summary?.checks[1]?.pass, true);
|
|
117
|
+
assert.equal(summary?.checks[2]?.pass, false, 'negative-input failures must stay visible');
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
test('command starter rejects modified or missing protected tests and package metadata', async (t) => {
|
|
122
|
+
const cwd = tmp(t, 'skillfit-command-protected-');
|
|
123
|
+
const dir = join(cwd, 'bench');
|
|
124
|
+
await runBenchInit({ dir, kind: 'command', yes: true, log: () => { } });
|
|
125
|
+
for (const file of ['package.json', 'test.mjs']) {
|
|
126
|
+
for (const mutation of ['modify', 'remove'])
|
|
127
|
+
await t.test(`${mutation} ${file}`, async () => {
|
|
128
|
+
const runDir = join(cwd, `${mutation}-${file}`);
|
|
129
|
+
cpSync(join(dir, 'fixtures/example-task'), runDir, { recursive: true });
|
|
130
|
+
writeFileSync(join(runDir, 'index.js'), 'export const add = (a, b) => a + b;');
|
|
131
|
+
if (mutation === 'remove')
|
|
132
|
+
rmSync(join(runDir, file));
|
|
133
|
+
else
|
|
134
|
+
writeFileSync(join(runDir, file), file === 'package.json' ? '{"type":"module"}' : '// tests removed');
|
|
135
|
+
const result = await runVerifier(dir, 'node verifiers/example-task.mjs', runDir);
|
|
136
|
+
assert.equal(result.exitCode, 1, result.output);
|
|
137
|
+
assert.equal(parseVerifierSummary(result.output)?.checks[0]?.pass, false);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
test('bench init CLI validates template kind and keeps existing output untouched', (t) => {
|
|
142
|
+
const cwd = tmp(t, 'skillfit-command-cli-');
|
|
143
|
+
const cli = join(PACKAGE_ROOT, 'dist/cli.js');
|
|
144
|
+
const dir = join(cwd, 'bench');
|
|
145
|
+
const invalid = spawnSync(process.execPath, [cli, 'bench', 'init', dir, '--kind', 'typo', '--yes'], { encoding: 'utf8' });
|
|
146
|
+
assert.notEqual(invalid.status, 0);
|
|
147
|
+
assert.match(invalid.stderr, /Unknown --kind/);
|
|
148
|
+
assert.ok(!existsSync(dir));
|
|
149
|
+
const misplaced = spawnSync(process.execPath, [cli, 'bench', 'check', dir, '--kind', 'command'], { encoding: 'utf8' });
|
|
150
|
+
assert.notEqual(misplaced.status, 0);
|
|
151
|
+
assert.match(misplaced.stderr, /--kind applies only to bench init/);
|
|
152
|
+
const created = spawnSync(process.execPath, [cli, 'bench', 'init', dir, '--kind', 'command', '--yes'], { encoding: 'utf8' });
|
|
153
|
+
assert.equal(created.status, 0, created.stderr);
|
|
154
|
+
const manifest = readFileSync(join(dir, 'bench.json'), 'utf8');
|
|
155
|
+
const collision = spawnSync(process.execPath, [cli, 'bench', 'init', dir, '--kind', 'command', '--yes'], { encoding: 'utf8' });
|
|
156
|
+
assert.notEqual(collision.status, 0);
|
|
157
|
+
assert.match(collision.stderr, /not empty/);
|
|
158
|
+
assert.equal(readFileSync(join(dir, 'bench.json'), 'utf8'), manifest);
|
|
159
|
+
});
|
|
59
160
|
test('runBenchInit refuses a non-empty target directory', async (t) => {
|
|
60
161
|
const cwd = tmp(t, 'skillfit-bench-init-');
|
|
61
162
|
const dir = join(cwd, 'skillfit-bench');
|