skillfit 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +41 -15
  2. package/README.zh-CN.md +41 -15
  3. package/benches/README.md +23 -0
  4. package/benches/contrib/README.md +1 -0
  5. package/benches/contrib/oss-skill-independent/README.md +60 -0
  6. package/benches/contrib/oss-skill-independent/bench.json +79 -0
  7. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/LICENSE +22 -0
  8. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/Readme.md +1015 -0
  9. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/esm.mjs +15 -0
  10. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/index.js +27 -0
  11. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/argument.js +147 -0
  12. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/command.js +1944 -0
  13. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/error.js +45 -0
  14. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/help.js +396 -0
  15. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/option.js +208 -0
  16. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/suggestSimilar.js +100 -0
  17. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package-support.json +16 -0
  18. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package.json +63 -0
  19. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test-clock.mjs +65 -0
  20. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test.mjs +4 -0
  21. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.d.ts +774 -0
  22. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.test-d.ts +416 -0
  23. package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/upstream-package.json +69 -0
  24. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/LICENSE +22 -0
  25. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/Readme.md +1149 -0
  26. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/esm.mjs +16 -0
  27. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/index.js +24 -0
  28. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/argument.js +149 -0
  29. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/command.js +2662 -0
  30. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/error.js +39 -0
  31. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/help.js +713 -0
  32. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/option.js +367 -0
  33. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/suggestSimilar.js +101 -0
  34. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package-support.json +16 -0
  35. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package.json +71 -0
  36. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test-clock.mjs +65 -0
  37. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test.mjs +4 -0
  38. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/esm.d.mts +3 -0
  39. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.d.ts +1045 -0
  40. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.test-d.ts +737 -0
  41. package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/upstream-package.json +82 -0
  42. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.d.ts +40 -0
  43. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.js +68 -0
  44. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/license +9 -0
  45. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/package.json +54 -0
  46. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/readme.md +99 -0
  47. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test-clock.mjs +65 -0
  48. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test.mjs +4 -0
  49. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/upstream-package.json +54 -0
  50. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/index.js +67 -0
  51. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/license +9 -0
  52. package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/package.json +46 -0
  53. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.d.ts +136 -0
  54. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.js +132 -0
  55. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/license +9 -0
  56. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/package.json +57 -0
  57. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/readme.md +181 -0
  58. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test-clock.mjs +65 -0
  59. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test.mjs +4 -0
  60. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/upstream-package.json +58 -0
  61. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
  62. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
  63. package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
  64. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.d.ts +136 -0
  65. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.js +116 -0
  66. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/license +9 -0
  67. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/package.json +60 -0
  68. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/readme.md +170 -0
  69. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test-clock.mjs +65 -0
  70. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test.mjs +4 -0
  71. package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/upstream-package.json +60 -0
  72. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.d.ts +149 -0
  73. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.js +93 -0
  74. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/license +9 -0
  75. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/package.json +52 -0
  76. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/readme.md +192 -0
  77. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test-clock.mjs +65 -0
  78. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test.mjs +4 -0
  79. package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/upstream-package.json +52 -0
  80. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.d.ts +151 -0
  81. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.js +114 -0
  82. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/license +9 -0
  83. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/package.json +48 -0
  84. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/readme.md +158 -0
  85. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test-clock.mjs +65 -0
  86. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test.mjs +4 -0
  87. package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/upstream-package.json +48 -0
  88. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.d.ts +151 -0
  89. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.js +122 -0
  90. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/license +9 -0
  91. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/package.json +50 -0
  92. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/readme.md +190 -0
  93. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test-clock.mjs +65 -0
  94. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test.mjs +4 -0
  95. package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/upstream-package.json +50 -0
  96. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/LICENSE +22 -0
  97. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/Readme.md +1015 -0
  98. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/esm.mjs +15 -0
  99. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/index.js +27 -0
  100. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/argument.js +147 -0
  101. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/command.js +1948 -0
  102. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/error.js +45 -0
  103. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/help.js +396 -0
  104. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/option.js +208 -0
  105. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/suggestSimilar.js +100 -0
  106. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package-support.json +16 -0
  107. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package.json +63 -0
  108. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/regression.test.mjs +5 -0
  109. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test-clock.mjs +65 -0
  110. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test.mjs +4 -0
  111. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.d.ts +774 -0
  112. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.test-d.ts +416 -0
  113. package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/upstream-package.json +69 -0
  114. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/LICENSE +22 -0
  115. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/Readme.md +1149 -0
  116. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/esm.mjs +16 -0
  117. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/index.js +24 -0
  118. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/argument.js +149 -0
  119. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/command.js +2666 -0
  120. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/error.js +39 -0
  121. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/help.js +713 -0
  122. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/option.js +367 -0
  123. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/suggestSimilar.js +101 -0
  124. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package-support.json +16 -0
  125. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package.json +71 -0
  126. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/regression.test.mjs +5 -0
  127. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test-clock.mjs +65 -0
  128. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test.mjs +4 -0
  129. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/esm.d.mts +3 -0
  130. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.d.ts +1045 -0
  131. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.test-d.ts +737 -0
  132. package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/upstream-package.json +82 -0
  133. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/async-hooks-stub.js +15 -0
  134. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.d.ts +40 -0
  135. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.js +71 -0
  136. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/license +9 -0
  137. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/package.json +61 -0
  138. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/readme.md +99 -0
  139. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/regression.test.mjs +6 -0
  140. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test-clock.mjs +65 -0
  141. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test.mjs +4 -0
  142. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/upstream-package.json +54 -0
  143. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/index.js +67 -0
  144. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/license +9 -0
  145. package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/package.json +46 -0
  146. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.d.ts +136 -0
  147. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.js +148 -0
  148. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/license +9 -0
  149. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/package.json +57 -0
  150. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/readme.md +181 -0
  151. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/regression.test.mjs +5 -0
  152. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test-clock.mjs +65 -0
  153. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test.mjs +4 -0
  154. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/upstream-package.json +58 -0
  155. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
  156. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
  157. package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
  158. package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-async-listener-order.mjs +1 -0
  159. package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-output-isolation.mjs +1 -0
  160. package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-async-context.mjs +1 -0
  161. package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-map-iteration-rejection.mjs +1 -0
  162. package/benches/contrib/oss-skill-independent/ground-truth/oracle-throttle-sync-throw.mjs +1 -0
  163. package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-custom-timers.mjs +1 -0
  164. package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-infinity-abort.mjs +1 -0
  165. package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-rejection-listener.mjs +1 -0
  166. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.d.ts +136 -0
  167. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.js +121 -0
  168. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/license +9 -0
  169. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/package.json +60 -0
  170. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/readme.md +170 -0
  171. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/regression.test.mjs +6 -0
  172. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test-clock.mjs +65 -0
  173. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test.mjs +4 -0
  174. package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/upstream-package.json +60 -0
  175. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.d.ts +149 -0
  176. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.js +95 -0
  177. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/license +9 -0
  178. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/package.json +52 -0
  179. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/readme.md +192 -0
  180. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/regression.test.mjs +5 -0
  181. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test-clock.mjs +65 -0
  182. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test.mjs +4 -0
  183. package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/upstream-package.json +52 -0
  184. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.d.ts +151 -0
  185. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.js +114 -0
  186. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/license +9 -0
  187. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/package.json +48 -0
  188. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/readme.md +158 -0
  189. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/regression.test.mjs +5 -0
  190. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test-clock.mjs +65 -0
  191. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test.mjs +4 -0
  192. package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/upstream-package.json +48 -0
  193. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.d.ts +151 -0
  194. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.js +122 -0
  195. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/license +9 -0
  196. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/package.json +50 -0
  197. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/readme.md +190 -0
  198. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/regression.test.mjs +5 -0
  199. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test-clock.mjs +65 -0
  200. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test.mjs +4 -0
  201. package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/upstream-package.json +50 -0
  202. package/benches/contrib/oss-skill-independent/prompts/commander-async-listener-order.md +3 -0
  203. package/benches/contrib/oss-skill-independent/prompts/commander-output-isolation.md +3 -0
  204. package/benches/contrib/oss-skill-independent/prompts/limit-async-context.md +3 -0
  205. package/benches/contrib/oss-skill-independent/prompts/limit-map-iteration-rejection.md +3 -0
  206. package/benches/contrib/oss-skill-independent/prompts/throttle-sync-throw.md +3 -0
  207. package/benches/contrib/oss-skill-independent/prompts/timeout-custom-timers.md +3 -0
  208. package/benches/contrib/oss-skill-independent/prompts/timeout-infinity-abort.md +3 -0
  209. package/benches/contrib/oss-skill-independent/prompts/timeout-rejection-listener.md +3 -0
  210. package/benches/contrib/oss-skill-independent/provenance.json +1903 -0
  211. package/benches/contrib/oss-skill-independent/task-specs.json +63 -0
  212. package/benches/contrib/oss-skill-independent/test-clock.mjs +65 -0
  213. package/benches/contrib/oss-skill-independent/verifiers/cases.mjs +197 -0
  214. package/benches/contrib/oss-skill-independent/verifiers/commander-async-listener-order.mjs +1 -0
  215. package/benches/contrib/oss-skill-independent/verifiers/commander-output-isolation.mjs +1 -0
  216. package/benches/contrib/oss-skill-independent/verifiers/grade.mjs +48 -0
  217. package/benches/contrib/oss-skill-independent/verifiers/limit-async-context.mjs +1 -0
  218. package/benches/contrib/oss-skill-independent/verifiers/limit-map-iteration-rejection.mjs +1 -0
  219. package/benches/contrib/oss-skill-independent/verifiers/probe.mjs +16 -0
  220. package/benches/contrib/oss-skill-independent/verifiers/regression-evidence.mjs +105 -0
  221. package/benches/contrib/oss-skill-independent/verifiers/test-reporter.mjs +29 -0
  222. package/benches/contrib/oss-skill-independent/verifiers/throttle-sync-throw.mjs +1 -0
  223. package/benches/contrib/oss-skill-independent/verifiers/timeout-custom-timers.mjs +1 -0
  224. package/benches/contrib/oss-skill-independent/verifiers/timeout-infinity-abort.mjs +1 -0
  225. package/benches/contrib/oss-skill-independent/verifiers/timeout-rejection-listener.mjs +1 -0
  226. package/dist/cli.js +166 -53
  227. package/dist/commands/bench-check-json.test.js +221 -0
  228. package/dist/commands/bench-check-report.js +48 -0
  229. package/dist/commands/bench-command-template.js +129 -0
  230. package/dist/commands/bench-manage.js +91 -0
  231. package/dist/commands/bench-manage.test.js +87 -0
  232. package/dist/commands/bench.js +68 -38
  233. package/dist/commands/bench.test.js +101 -0
  234. package/dist/commands/eval-component.js +17 -0
  235. package/dist/commands/eval-export.js +152 -0
  236. package/dist/commands/eval-export.test.js +122 -0
  237. package/dist/commands/eval.js +14 -3
  238. package/dist/commands/eval.test.js +58 -1
  239. package/dist/harness/bench.js +21 -2
  240. package/dist/harness/eval-audit.js +42 -4
  241. package/dist/harness/eval-budget.js +51 -0
  242. package/dist/harness/eval-budget.test.js +210 -0
  243. package/dist/harness/eval-component.test.js +36 -0
  244. package/dist/harness/eval-contract.js +5 -1
  245. package/dist/harness/replay-package.js +85 -0
  246. package/dist/harness/runner.js +22 -1
  247. package/docs/bench-authoring.md +40 -0
  248. package/docs/bench-check-json.md +115 -0
  249. package/docs/case-management.md +65 -0
  250. package/docs/eval-component.md +60 -49
  251. package/docs/examples/check-receiver-mechanism-proposal.mjs +124 -0
  252. package/docs/examples/prepare-native-diff-probe.mjs +75 -0
  253. package/docs/examples/reproduce-independent-comparison-budget.mjs +73 -0
  254. package/docs/first-real-eval.md +6 -0
  255. package/docs/growth-roadmap-2026-10.md +57 -93
  256. package/docs/metrics.md +21 -0
  257. package/docs/plans/2026-10-14-evidence-and-release-sequence.md +29 -12
  258. package/docs/plans/2026-10-15-independent-comparison-budget.json +1769 -0
  259. package/docs/plans/2026-10-15-independent-comparison-inputs.json +373 -0
  260. package/docs/plans/2026-10-15-independent-comparison-proposal.md +177 -0
  261. package/docs/plans/2026-10-15-native-diff-mechanism.md +105 -0
  262. package/docs/plans/2026-10-15-receiver-mechanism-proposal.json +342 -0
  263. package/docs/plans/2026-10-15-receiver-mechanism-proposal.md +146 -0
  264. package/docs/plans/2026-10-15-receiver-mechanism-verification.json +105 -0
  265. package/docs/plans/2026-10-16-case-workflow-and-release.md +30 -0
  266. package/docs/releases/0.10.0.md +45 -0
  267. package/docs/releases/0.9.1-first-publication.json +249 -0
  268. package/docs/releases/0.9.1-verification.json +122 -0
  269. package/docs/releases/0.9.1.md +33 -1
  270. package/docs/releases/trusted-publishing.md +61 -0
  271. package/docs/replay-packages.md +88 -0
  272. package/docs/schemas/bench-check.schema.json +109 -0
  273. package/docs/schemas/eval-request.schema.json +12 -0
  274. package/docs/sharing-results.md +6 -0
  275. package/docs/skill-evaluation-evidence.md +52 -0
  276. package/evidence/2026-10-15-diagnosing-receiver-correction.md +140 -0
  277. package/evidence/2026-10-15-independent-comparison-regression-stop.md +162 -0
  278. package/evidence/2026-10-15-independent-offline-readiness.md +144 -0
  279. package/evidence/2026-10-15-native-diff-mechanism.md +196 -0
  280. package/evidence/2026-10-15-receiver-mechanism-stop.md +154 -0
  281. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/README.md +35 -0
  282. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/expected.json +577 -0
  283. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/receiver-contract.test.mjs +138 -0
  284. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/replay.mjs +127 -0
  285. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/verification.json +105 -0
  286. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/README.md +32 -0
  287. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/checks.json +32 -0
  288. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
  289. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/verification.json +25 -0
  290. package/evidence/artifacts/2026-10-15-independent-offline-readiness/README.md +17 -0
  291. package/evidence/artifacts/2026-10-15-independent-offline-readiness/verification.json +1548 -0
  292. package/evidence/artifacts/2026-10-15-native-diff-mechanism/README.md +48 -0
  293. package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
  294. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/README.md +38 -0
  295. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/checks.json +118 -0
  296. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
  297. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/verification.json +36 -0
  298. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/LICENSE +21 -0
  299. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/SKILL.md +51 -0
  300. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/agents/openai.yaml +3 -0
  301. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/scripts/hitl-loop.template.sh +44 -0
  302. package/package.json +1 -1
  303. package/skills/skillfit/SKILL.md +17 -5
@@ -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');
@@ -6,15 +6,28 @@ import { auditEvaluation, stoppedAccounting } from '../harness/eval-audit.js';
6
6
  import { loadEvalRequest, parseAcceptancePolicy, policyHash, readComponentJson, record } from '../harness/eval-contract.js';
7
7
  import { hashFileSet, listFilesRecursive, sha256Text } from '../harness/hash.js';
8
8
  import { runEval } from './eval.js';
9
+ import { spendingBudgetReport } from '../harness/eval-budget.js';
10
+ import { verifyReplayPackage } from '../harness/replay-package.js';
9
11
  export function componentError(error, code = 'INVALID_OR_FAILED_EVALUATION') {
10
12
  return { schemaVersion: 1, kind: 'skillfit.eval-error', status: 'error',
11
13
  error: { code, message: error instanceof Error ? error.message : String(error) },
12
14
  acceptance: { decision: 'inconclusive', eligibleForUpgrade: false, automaticUpgrade: false } };
13
15
  }
14
16
  export async function reportEvalComponent(path, options = {}) {
17
+ if (statSync(resolve(path)).isDirectory() && existsSync(join(resolve(path), 'replay-package.json'))) {
18
+ if (options.recordsPath || options.benchDir)
19
+ throw new Error('Portable packages already pin their run and bench; external overrides are not allowed.');
20
+ const metadata = verifyReplayPackage(resolve(path));
21
+ return { ...await reportNativeEvaluation(join(resolve(path), 'run'), { ...options, benchDir: join(resolve(path), 'inputs/bench') }),
22
+ portablePackage: { integrityVerified: true, sourcePlanSha256: metadata.sourcePlanSha256, files: Object.keys(metadata.files).length } };
23
+ }
24
+ return reportNativeEvaluation(path, options);
25
+ }
26
+ async function reportNativeEvaluation(path, options) {
15
27
  const input = resolve(path), directory = statSync(input).isDirectory();
16
28
  const manifestPath = directory ? join(input, 'manifest.json') : input;
17
29
  const runDir = resolve(options.recordsPath ?? (directory ? input : dirname(input)));
30
+ const spendingBudget = spendingBudgetReport(runDir);
18
31
  if (!existsSync(manifestPath)) {
19
32
  if (!directory || !existsSync(join(runDir, '_plan.json')))
20
33
  throw new Error('No saved manifest or native plan found.');
@@ -22,6 +35,7 @@ export async function reportEvalComponent(path, options = {}) {
22
35
  const session = existsSync(sessionPath) ? record(readComponentJson(sessionPath).value, 'session') : null;
23
36
  return { schemaVersion: 1, kind: 'skillfit.eval-result', status: session ? 'stopped' : 'incomplete',
24
37
  manifest: null, session, costs: stoppedAccounting(runDir), evidence: { verified: false, runDir, reasons: ['No final evaluation manifest; retained spending only.'] },
38
+ ...(spendingBudget ? { spendingBudget } : {}),
25
39
  acceptance: { decision: 'inconclusive', eligibleForUpgrade: false, automaticUpgrade: false,
26
40
  reasons: [{ code: 'EXPERIMENT_NOT_COMPLETED', message: 'No completed paired evaluation is available.' }] } };
27
41
  }
@@ -31,6 +45,7 @@ export async function reportEvalComponent(path, options = {}) {
31
45
  const result = assessEvaluation(data.value, audit, policy);
32
46
  const nativePlan = audit.verified ? record(readComponentJson(join(runDir, '_plan.json')).value, 'native plan') : null;
33
47
  return { ...result, manifest: { path: manifestPath, sha256: data.sha256, schemaVersion: 4 },
48
+ ...(spendingBudget ? { spendingBudget } : {}),
34
49
  environment: nativePlan ? { nodeVersion: nativePlan.nodeVersion, agent: nativePlan.agent,
35
50
  pairOrder: record(nativePlan.details, 'native plan details').pairOrder ?? null,
36
51
  executorTimeoutSeconds: record(nativePlan.details, 'native plan details').executorTimeoutSeconds ?? null,
@@ -53,6 +68,8 @@ export async function runEvalComponent(requestPath, options) {
53
68
  bench: request.bench, agent: request.agent, mode: 'installed', inputMode: 'workspace', trials: request.trials,
54
69
  maxCalls: request.maxCalls, pairOrder: request.pairOrder, runsRoot: request.runsRoot, runGroup: request.runGroup, yes: true, dryRun: true,
55
70
  executorTimeoutSeconds: request.executorTimeoutSeconds,
71
+ ...(request.taskIds ? { taskIds: request.taskIds } : {}),
72
+ ...(request.spendingBudget ? { spendingBudget: request.spendingBudget } : {}),
56
73
  judgeExecutor: null, executor: options.executor, sessionOptions: options.sessionOptions,
57
74
  skillInstallDir: options.skillInstallDir, log: options.log ?? (() => { }) };
58
75
  let prepared;
@@ -0,0 +1,152 @@
1
+ import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
3
+ import { loadBench } from '../harness/bench.js';
4
+ import { hashFileSet, sha256File } from '../harness/hash.js';
5
+ import { packageFiles, packageMember, portableReproducer, verifyReplayPackage } from '../harness/replay-package.js';
6
+ import { reportEvalComponent } from './eval-component.js';
7
+ function overlaps(root, path) {
8
+ const rel = relative(root, path);
9
+ return !isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`);
10
+ }
11
+ function physical(path) {
12
+ let parent = resolve(path);
13
+ const parts = [];
14
+ while (!existsSync(parent)) {
15
+ parts.unshift(basename(parent));
16
+ parent = dirname(parent);
17
+ }
18
+ return join(realpathSync(parent), ...parts);
19
+ }
20
+ export async function exportEvaluation(input, output, options = {}) {
21
+ const overrides = new Map();
22
+ for (const entry of options.inputRoots ?? []) {
23
+ const at = entry.indexOf('='), label = entry.slice(0, at), path = entry.slice(at + 1);
24
+ if (at < 1 || !path || !['bench', 'target', 'baseline-skill', 'implementation', 'request'].includes(label) || overrides.has(label))
25
+ throw new Error(`Invalid or repeated --input-root: ${entry}`);
26
+ overrides.set(label, resolve(path));
27
+ }
28
+ if (options.benchDir && overrides.has('bench'))
29
+ throw new Error('Use either --bench or --input-root bench=path, not both.');
30
+ const source = resolve(input), run = lstatSync(source).isDirectory() ? source : dirname(source), destination = resolve(output);
31
+ try {
32
+ lstatSync(destination);
33
+ throw new Error(`Export destination already exists: ${destination}`);
34
+ }
35
+ catch (error) {
36
+ if (error.code !== 'ENOENT')
37
+ throw error;
38
+ }
39
+ const planBytes = readFileSync(join(run, '_plan.json'));
40
+ const plan = JSON.parse(planBytes.toString('utf8'));
41
+ const session = JSON.parse(readFileSync(join(run, '_session.json'), 'utf8'));
42
+ const index = JSON.parse(readFileSync(join(run, '_artifacts.json'), 'utf8'));
43
+ const planSha256 = sha256File(join(run, '_plan.json'));
44
+ if (session.planSha256 !== planSha256 || index.planSha256 !== planSha256 || !index.files || !index.links || Object.keys(index.links).length)
45
+ throw new Error('Native evidence is unsealed, changed, or contains nonportable links.');
46
+ const files = packageFiles(run).filter(path => path !== '_artifacts.json');
47
+ if (JSON.stringify(files) !== JSON.stringify(Object.keys(index.files).sort()))
48
+ throw new Error('Native evidence inventory changed.');
49
+ for (const path of files)
50
+ if (sha256File(packageMember(run, path)) !== index.files[path])
51
+ throw new Error(`Native evidence hash mismatch: ${path}`);
52
+ const report = await reportEvalComponent(run);
53
+ const hasManifest = existsSync(join(run, 'manifest.json'));
54
+ if (hasManifest && (!('evidence' in report) || !report.evidence.verified))
55
+ throw new Error(`Native evidence audit failed; cannot export a complete replay package: ${'evidence' in report ? JSON.stringify(report.evidence) : 'missing audit'}`);
56
+ if (plan.details?.mode === 'trigger' || plan.details?.judge != null)
57
+ throw new Error('Portable replay currently requires paired native runs without a judge; separate judge spending is not fully recorded.');
58
+ if (!Array.isArray(plan.inputs) || typeof plan.packageVersion !== 'string')
59
+ throw new Error('Native input fingerprints or version are missing.');
60
+ const copies = [];
61
+ for (const path of [...files, '_artifacts.json'])
62
+ copies.push({ source: packageMember(run, path), target: `run/${path}`, sha256: sha256File(join(run, path)) });
63
+ const required = ['bench', 'target', 'implementation'];
64
+ if (plan.details?.baselineTarget)
65
+ required.push('baseline Skill');
66
+ const roots = [run];
67
+ for (const label of required) {
68
+ const fingerprint = plan.inputs.find((entry) => entry.label === label);
69
+ if (!fingerprint || !Array.isArray(fingerprint.files) || typeof fingerprint.root !== 'string')
70
+ throw new Error(`Missing pinned input: ${label}`);
71
+ const alias = label === 'baseline Skill' ? 'baseline-skill' : label;
72
+ const root = overrides.get(alias) ?? (label === 'bench' && options.benchDir ? resolve(options.benchDir) : fingerprint.root);
73
+ roots.push(root);
74
+ const prefix = label === 'implementation' ? 'runtime/dist' : `inputs/${label === 'baseline Skill' ? 'baseline-skill' : label}`;
75
+ const paths = fingerprint.files;
76
+ // Every path must be safe before it is read; no configuration or global Skill roots are copied.
77
+ for (const path of paths)
78
+ packageMember(root, path);
79
+ if (hashFileSet(root, paths) !== fingerprint.sha256)
80
+ throw new Error(`Pinned ${label} input changed or is unavailable; recover the original files before exporting.`);
81
+ for (const path of paths)
82
+ copies.push({ source: packageMember(root, path), target: `${prefix}/${path}`, sha256: sha256File(join(root, path)) });
83
+ }
84
+ const request = plan.guardFiles?.find((file) => file.label === 'component request');
85
+ for (const [label] of overrides)
86
+ if (!(label === 'request' && request) && !required.includes(label === 'baseline-skill' ? 'baseline Skill' : label))
87
+ throw new Error(`Input root is not part of this run: ${label}`);
88
+ if (request) {
89
+ const path = overrides.get('request') ?? request.path;
90
+ if (!lstatSync(path).isFile() || sha256File(path) !== request.sha256)
91
+ throw new Error('Frozen request changed; recover the original request before exporting.');
92
+ copies.push({ source: path, target: 'inputs/request.json', sha256: request.sha256 });
93
+ }
94
+ if (roots.some(root => overlaps(physical(root), physical(destination))))
95
+ throw new Error('Export destination must be outside the native run and pinned input roots.');
96
+ const log = options.log ?? console.log;
97
+ const apply = options.yes === true && !options.dryRun;
98
+ const preview = { schemaVersion: 1, kind: 'skillfit.eval-export', status: apply ? 'exported' : 'planned',
99
+ source: run, destination, sourcePlanSha256: planSha256, nativeStatus: session.status, hasManifest,
100
+ files: copies.length + 3, bytes: copies.reduce((sum, file) => sum + lstatSync(file.source).size, 0),
101
+ inputs: roots, modelCalls: 0, sharingReviewRequired: true };
102
+ log(`Portable export: ${run} -> ${destination}`);
103
+ for (const root of roots)
104
+ log(` source: ${root}`);
105
+ log(`${preview.files} payload files; ${preview.bytes} source bytes. Review paths, prompts and outputs before sharing.`);
106
+ if (!apply) {
107
+ log('Plan only — re-run with --yes to export.');
108
+ return preview;
109
+ }
110
+ mkdirSync(dirname(destination), { recursive: true });
111
+ const stage = mkdtempSync(join(dirname(destination), '.skillfit-export-'));
112
+ try {
113
+ for (const file of copies) {
114
+ const bytes = readFileSync(file.source);
115
+ if (sha256File(file.source) !== file.sha256)
116
+ throw new Error(`Source changed during export: ${file.source}`);
117
+ const target = join(stage, file.target);
118
+ mkdirSync(dirname(target), { recursive: true });
119
+ writeFileSync(target, bytes, { flag: 'wx' });
120
+ if (sha256File(target) !== file.sha256)
121
+ throw new Error(`Export copy verification failed: ${file.target}`);
122
+ }
123
+ const bench = loadBench(join(stage, 'inputs/bench'));
124
+ if (hasManifest) {
125
+ const manifest = JSON.parse(readFileSync(join(stage, 'run/manifest.json'), 'utf8'));
126
+ if (bench.contentSha256 !== manifest.bench.contentSha256)
127
+ throw new Error('Exported bench does not match the frozen manifest.');
128
+ }
129
+ writeFileSync(join(stage, 'runtime/package.json'), JSON.stringify({ private: true, type: 'module', version: plan.packageVersion }) + '\n');
130
+ writeFileSync(join(stage, 'reproduce.mjs'), portableReproducer());
131
+ writeFileSync(join(stage, 'README.md'), '# Offline evaluation replay\n\nRun `node reproduce.mjs --verify-only` to check files, or `node reproduce.mjs` to regrade saved deliveries with the pinned implementation. No agent or model is started. Local verifiers are executable code; use trusted packages. Node.js 22+ and any external verifier toolchains are required.\n\nNative receipts are unchanged. Unknown/partial costs stay unknown/partial; a stopped run remains stopped. Checksums detect changes, not publisher identity. Review project data and paths before sharing. Runtime package metadata is reconstructed from the frozen native package version; compiled implementation bytes are copied unchanged.\n');
132
+ const payload = packageFiles(stage);
133
+ writeFileSync(join(stage, 'replay-package.json'), JSON.stringify({ schemaVersion: 1, kind: 'skillfit.replay-package',
134
+ sourcePlanSha256: planSha256, hasManifest, nativeStatus: session.status,
135
+ files: Object.fromEntries(payload.map(path => [path, sha256File(join(stage, path))])) }, null, 2) + '\n');
136
+ verifyReplayPackage(stage);
137
+ // Exclusive mkdir protects even empty directories and dangling symlinks that
138
+ // appeared after preview. Transfer only into the directory this call owns.
139
+ mkdirSync(destination);
140
+ for (const file of readdirSync(stage).filter(file => file !== 'replay-package.json'))
141
+ renameSync(join(stage, file), join(destination, file));
142
+ renameSync(join(stage, 'replay-package.json'), join(destination, 'replay-package.json'));
143
+ verifyReplayPackage(destination);
144
+ rmSync(stage, { recursive: true, force: true });
145
+ }
146
+ catch (error) {
147
+ rmSync(stage, { recursive: true, force: true });
148
+ throw error;
149
+ }
150
+ log(`Exported and verified. Replay: node ${join(destination, 'reproduce.mjs')}`);
151
+ return preview;
152
+ }
@@ -0,0 +1,122 @@
1
+ import assert from 'node:assert/strict';
2
+ import { spawnSync } from 'node:child_process';
3
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
4
+ import { tmpdir } from 'node:os';
5
+ import { join } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { test } from 'node:test';
8
+ import { runBenchInit } from './bench.js';
9
+ import { runEval } from './eval.js';
10
+ import { exportEvaluation } from './eval-export.js';
11
+ import { reportEvalComponent } from './eval-component.js';
12
+ import { MockExecutor } from '../harness/executors/mock.js';
13
+ import { packageMember, verifyReplayPackage } from '../harness/replay-package.js';
14
+ import { loadBench } from '../harness/bench.js';
15
+ import { collectEvaluationTarget } from '../harness/target.js';
16
+ import { ExperimentSession } from '../harness/experiment-session.js';
17
+ import { runTrial } from '../harness/runner.js';
18
+ import { ExecutorFailure } from '../harness/types.js';
19
+ async function fixture(t, stopped = false) {
20
+ const root = mkdtempSync(join(tmpdir(), 'skillfit-export-'));
21
+ t.after(() => rmSync(root, { recursive: true, force: true }));
22
+ const bench = join(root, 'bench'), skill = join(root, 'skill'), runsRoot = join(root, 'runs'), run = join(runsRoot, 'saved');
23
+ await runBenchInit({ dir: bench, yes: true, log: () => { } });
24
+ mkdirSync(skill);
25
+ writeFileSync(join(skill, 'SKILL.md'), '# Synthetic export test\n');
26
+ const mock = new MockExecutor();
27
+ let calls = 0;
28
+ const executor = { describe: () => mock.describe(), run: async (...args) => {
29
+ calls++;
30
+ if (stopped)
31
+ throw new ExecutorFailure('synthetic stop', { output: 'partial result', tokens: { input: 9, cachedInput: 3, output: 2 }, usageStatus: 'partial' });
32
+ return mock.run(...args);
33
+ } };
34
+ if (!stopped)
35
+ await runEval({ skillPath: skill, bench, taskIds: ['example-task'], trials: 1, maxCalls: 2,
36
+ executor, judgeExecutor: null, dryRun: false, yes: true, runsRoot, runGroup: 'saved', log: () => { } });
37
+ else {
38
+ const target = collectEvaluationTarget(skill), loaded = loadBench(bench);
39
+ const session = new ExperimentSession({ bench: loaded, target, groupDir: run, workspaces: [join(run, 'example-task/baseline/trial-1')],
40
+ plannedCalls: 2, maxCalls: 2, injected: true, details: { mode: 'inject' } });
41
+ await runTrial({ bench: loaded, target, executor: session.wrap(executor, 'agent'), trials: 1, runsRoot, runGroup: 'saved', log: () => { } }, 'example-task', 'baseline', 1);
42
+ session.finish(new Error('synthetic stop'));
43
+ }
44
+ return { root, bench, skill, run, output: join(root, 'portable'), calls: () => calls };
45
+ }
46
+ test('export previews are read-only and complete packages replay after original paths disappear', async (t) => {
47
+ const f = await fixture(t), originalPlan = readFileSync(join(f.run, '_plan.json'), 'utf8');
48
+ const plan = await exportEvaluation(f.run, f.output, { log: () => { } });
49
+ assert.equal(plan.status, 'planned');
50
+ assert.equal(plan.modelCalls, 0);
51
+ assert.ok(!existsSync(f.output));
52
+ await exportEvaluation(f.run, f.output, { yes: true, log: () => { } });
53
+ assert.equal(readFileSync(join(f.run, '_plan.json'), 'utf8'), originalPlan);
54
+ const moved = join(f.root, 'received package');
55
+ renameSync(f.output, moved);
56
+ rmSync(f.bench, { recursive: true });
57
+ rmSync(f.skill, { recursive: true });
58
+ rmSync(f.run, { recursive: true });
59
+ const checksum = spawnSync(process.execPath, [join(moved, 'reproduce.mjs'), '--verify-only'], { encoding: 'utf8' });
60
+ assert.equal(checksum.status, 0, checksum.stderr);
61
+ assert.equal(JSON.parse(checksum.stdout).modelCalls, 0);
62
+ const replay = spawnSync(process.execPath, [join(moved, 'reproduce.mjs')], { encoding: 'utf8', timeout: 30_000 });
63
+ assert.equal(replay.status, 0, replay.stderr);
64
+ const data = JSON.parse(replay.stdout);
65
+ assert.equal(data.evidence.verified, true);
66
+ assert.equal(data.acceptance.automaticUpgrade, false);
67
+ const inspected = await reportEvalComponent(moved, { replay: true });
68
+ assert.ok('portablePackage' in inspected && inspected.portablePackage.integrityVerified);
69
+ assert.equal(f.calls(), 2);
70
+ });
71
+ test('stopped exports preserve partial costs and cannot become completed evidence', async (t) => {
72
+ const f = await fixture(t, true), before = await reportEvalComponent(f.run);
73
+ assert.equal(before.status, 'stopped');
74
+ await exportEvaluation(f.run, f.output, { yes: true, log: () => { } });
75
+ const replay = spawnSync(process.execPath, [join(f.output, 'reproduce.mjs')], { encoding: 'utf8', timeout: 30_000 });
76
+ assert.equal(replay.status, 0, replay.stderr);
77
+ const data = JSON.parse(replay.stdout);
78
+ assert.equal(data.status, 'stopped');
79
+ assert.equal(data.evidence.verified, false);
80
+ assert.deepEqual(data.costs, 'costs' in before ? before.costs : null);
81
+ assert.equal(data.acceptance.eligibleForUpgrade, false);
82
+ assert.equal(f.calls(), 1);
83
+ });
84
+ test('missing inputs, nested destinations and collisions fail without modifying evidence', async (t) => {
85
+ const f = await fixture(t), original = readFileSync(join(f.run, '_artifacts.json'), 'utf8');
86
+ await assert.rejects(() => exportEvaluation(f.run, join(f.run, 'bad'), { yes: true, log: () => { } }), /outside/);
87
+ mkdirSync(f.output);
88
+ await assert.rejects(() => exportEvaluation(f.run, f.output, { yes: true, log: () => { } }), /already exists/);
89
+ rmSync(f.output, { recursive: true });
90
+ writeFileSync(join(f.skill, 'SKILL.md'), 'changed');
91
+ await assert.rejects(() => exportEvaluation(f.run, f.output, { yes: true, log: () => { } }), /input changed|unavailable/);
92
+ assert.ok(!existsSync(f.output));
93
+ assert.equal(readFileSync(join(f.run, '_artifacts.json'), 'utf8'), original);
94
+ });
95
+ test('portable inspections reject changed files, extra files and unsafe paths', async (t) => {
96
+ const f = await fixture(t);
97
+ await exportEvaluation(f.run, f.output, { yes: true, log: () => { } });
98
+ for (const path of ['../escape', '/absolute', 'C:/escape', 'a\\b', '.git/config'])
99
+ assert.throws(() => packageMember(f.output, path), /Unsafe/);
100
+ writeFileSync(join(f.output, 'extra'), 'unexpected');
101
+ assert.throws(() => verifyReplayPackage(f.output), /inventory/);
102
+ rmSync(join(f.output, 'extra'));
103
+ writeFileSync(join(f.output, 'run/manifest.json'), '{}');
104
+ await assert.rejects(() => reportEvalComponent(f.output, { replay: true }), /hash mismatch/);
105
+ const verify = spawnSync(process.execPath, [join(f.output, 'reproduce.mjs'), '--verify-only'], { encoding: 'utf8' });
106
+ assert.equal(verify.status, 2);
107
+ assert.equal(f.calls(), 2);
108
+ });
109
+ test('restored input roots still require original fingerprints and CLI exports are plans by default', async (t) => {
110
+ const f = await fixture(t), restored = join(f.root, 'restored-skill');
111
+ renameSync(f.skill, restored);
112
+ await assert.rejects(() => exportEvaluation(f.run, f.output, { log: () => { } }));
113
+ const cli = fileURLToPath(new URL('../cli.js', import.meta.url));
114
+ const result = spawnSync(process.execPath, [cli, 'report', 'eval', f.run, '--export', f.output,
115
+ '--input-root', `target=${restored}`, '--json'], { encoding: 'utf8' });
116
+ assert.equal(result.status, 0, result.stderr);
117
+ assert.equal(JSON.parse(result.stdout).status, 'planned');
118
+ assert.ok(!existsSync(f.output));
119
+ await exportEvaluation(f.run, f.output, { yes: true, inputRoots: [`target=${restored}`], log: () => { } });
120
+ assert.equal(verifyReplayPackage(f.output).hasManifest, true);
121
+ assert.equal(f.calls(), 2);
122
+ });
@@ -3,7 +3,7 @@ import { homedir } from 'node:os';
3
3
  import { join, resolve } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
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 { RUN_GROUP_PATTERN } from '../harness/constants.js';
8
8
  import { ExperimentSession, validateCallBudget } from '../harness/experiment-session.js';
9
9
  import { ApiExecutor } from '../harness/executors/api.js';
@@ -18,6 +18,7 @@ import { collectInstalledSkillFingerprint } from '../harness/bundle.js';
18
18
  import { installedUserSkills } from '../harness/receipts.js';
19
19
  import { collectEvaluationTarget } from '../harness/target.js';
20
20
  import { renderTriggerSummary, runTriggerExperiment, } from '../harness/trigger.js';
21
+ import { parseSpendingBudget } from '../harness/eval-budget.js';
21
22
  export const DEFAULT_EVAL_TRIALS = 5;
22
23
  function bundledBenchesRoot() {
23
24
  return fileURLToPath(new URL('../../benches', import.meta.url));
@@ -111,7 +112,7 @@ function sessionFor(options, bench, target, trials, runsRoot, runGroup, armNames
111
112
  maxCalls: options.maxCalls, agent: options.agent, injected: options.executor !== undefined,
112
113
  ...options.sessionOptions, guardFiles: options.guardFiles,
113
114
  workspaces: bench.tasks.flatMap(task => armNames.flatMap(arm => Array.from({ length: trials }, (_, i) => join(runsRoot, runGroup, task.id, arm, `trial-${i + 1}`)))),
114
- details });
115
+ details: { ...details, ...(options.taskIds ? { taskIds: bench.tasks.map(task => task.id) } : {}) } });
115
116
  }
116
117
  function estimatePromptTokens(bench, target, inputMode) {
117
118
  let fixtureBytes = 0;
@@ -272,6 +273,8 @@ async function runEvalTrigger(options, bench, skill, trials, log) {
272
273
  return manifest;
273
274
  }
274
275
  export async function runEval(options) {
276
+ if (options.spendingBudget !== undefined && options.mode === 'trigger')
277
+ throw new Error('spendingBudget applies only to paired evaluations.');
275
278
  const executorTimeoutSeconds = options.executorTimeoutSeconds ?? DEFAULT_CLI_TIMEOUT_MS / 1000;
276
279
  if (!Number.isSafeInteger(executorTimeoutSeconds) || executorTimeoutSeconds < 1 || executorTimeoutSeconds > 3600) {
277
280
  throw new Error('executorTimeoutSeconds must be an integer between 1 and 3600.');
@@ -305,7 +308,7 @@ export async function runEval(options) {
305
308
  throw new Error(`--trials must be an integer between 1 and 20, got ${trials}`);
306
309
  }
307
310
  const benchDir = resolveBenchDir(options.bench);
308
- const bench = loadBench(benchDir);
311
+ const bench = selectBenchTasks(loadBench(benchDir), options.taskIds);
309
312
  let target = collectEvaluationTarget(options.skillPath);
310
313
  let baselineTarget;
311
314
  let skillInstallDir;
@@ -371,6 +374,9 @@ export async function runEval(options) {
371
374
  throw new Error(`${target.kind} experiments require a CLI executor; API executors cannot load project configuration files.`);
372
375
  }
373
376
  const judge = options.judgeExecutor !== undefined ? options.judgeExecutor : resolveJudge(options.judgeAgent);
377
+ const spendingBudget = options.spendingBudget === undefined ? undefined : parseSpendingBudget(options.spendingBudget);
378
+ if (spendingBudget && judge)
379
+ throw new Error('spendingBudget requires a paired evaluation without a judge; judge usage is not covered.');
374
380
  if (options.judgeAgent && options.judgeAgent === options.agent) {
375
381
  log('Warning: judge and executor are the same agent — self-preference bias risk (docs/metrics.md L4).');
376
382
  }
@@ -389,6 +395,7 @@ export async function runEval(options) {
389
395
  bench: { name: bench.name, dir: bench.dir, sha256: bench.contentSha256, taskIds: bench.tasks.map(t => t.id) },
390
396
  executor: executor?.describe() ?? null, judge: judge?.describe() ?? null, inputMode,
391
397
  installDir: skillInstallDir ?? null, trials, plannedCalls, maxCalls, pairOrder,
398
+ ...(spendingBudget ? { spendingBudget } : {}),
392
399
  ...(installed ? { nativeDiffTool: nativeDiffDescriptor() } : {}),
393
400
  ...(options.agent || options.executorTimeoutSeconds !== undefined ? { executorTimeoutSeconds } : {}), outputDir: join(runsRoot, runGroup),
394
401
  });
@@ -396,6 +403,8 @@ export async function runEval(options) {
396
403
  log(renderPlan(bench, target, executor, judge, trials, runsRoot, runGroup, inputMode, baselineTarget));
397
404
  log(`Calls : ${plannedCalls} planned; ceiling ${maxCalls} (includes both judge orders when enabled)`);
398
405
  log(`Pair order: ${pairOrder}; arms remain adjacent`);
406
+ if (spendingBudget)
407
+ log(`Spending stop lines: ${JSON.stringify(spendingBudget)}; checked between calls, in-flight overshoot remains possible`);
399
408
  if (options.agent || options.executorTimeoutSeconds !== undefined)
400
409
  log(`Agent deadline: ${executorTimeoutSeconds}s per invocation in both arms`);
401
410
  if (skillInstallDir) {
@@ -410,6 +419,7 @@ export async function runEval(options) {
410
419
  }
411
420
  log(renderPlan(bench, target, executor, judge, trials, runsRoot, runGroup, inputMode, baselineTarget).replace(' (dry run)', '').replace(' (not created)', '').replace('Dry run — nothing was written.', `Calls : ${plannedCalls} planned; ceiling ${maxCalls}`));
412
421
  const session = sessionFor(options, bench, target, trials, runsRoot, runGroup, ['baseline', 'treatment'], plannedCalls, { mode: installed ? 'installed' : 'inject', inputMode, trials, pairOrder,
422
+ ...(spendingBudget ? { spendingBudget } : {}),
413
423
  ...(installed ? { nativeDiffTool: nativeDiffDescriptor() } : {}),
414
424
  ...(options.agent || options.executorTimeoutSeconds !== undefined ? { executorTimeoutSeconds } : {}), executor: executor.describe(), judge: judge?.describe() ?? null,
415
425
  ...(options.component ? { component: options.component } : {}),
@@ -422,6 +432,7 @@ export async function runEval(options) {
422
432
  baselineTarget,
423
433
  component: options.component,
424
434
  pairOrder,
435
+ ...(spendingBudget ? { spendingBudget } : {}),
425
436
  inputMode,
426
437
  ...(skillInstallDir ? { skillInstallDir, skillSearchDirs } : {}),
427
438
  executor: session.wrap(executor, 'agent'),
@@ -1,14 +1,71 @@
1
1
  import assert from 'node:assert/strict';
2
- import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { spawnSync } from 'node:child_process';
3
+ import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
3
4
  import { tmpdir } from 'node:os';
4
5
  import { join } from 'node:path';
5
6
  import { fileURLToPath } from 'node:url';
6
7
  import { test } from 'node:test';
7
8
  import { MockExecutor } from '../harness/executors/mock.js';
8
9
  import { runEval } from './eval.js';
10
+ import { loadBench, selectBenchTasks } from '../harness/bench.js';
11
+ import { reportEvalComponent } from './eval-component.js';
9
12
  const PACKAGE_ROOT = fileURLToPath(new URL('../..', import.meta.url));
10
13
  const BUNDLED_CODE_REVIEW = join(PACKAGE_ROOT, 'benches', 'code-review');
11
14
  const BUNDLED_DEBUGGING = join(PACKAGE_ROOT, 'benches', 'debugging');
15
+ test('task selection preserves manifest order and full hash; budgets and replay use only selected tasks', async (t) => {
16
+ const full = loadBench(BUNDLED_CODE_REVIEW);
17
+ const ids = [full.tasks[1].id, full.tasks[0].id];
18
+ const selected = selectBenchTasks(full, ids);
19
+ assert.deepEqual(selected.tasks.map(task => task.id), [...ids].reverse());
20
+ assert.equal(selected.contentSha256, full.contentSha256);
21
+ const root = tmp(t, 'skillfit-selection-'), runsRoot = join(root, 'runs');
22
+ let calls = 0;
23
+ const mock = new MockExecutor();
24
+ const executor = { describe: () => mock.describe(), run: async (...args) => { calls++; return mock.run(...args); } };
25
+ const base = { skillPath: makeSkill(t), bench: BUNDLED_CODE_REVIEW, taskIds: ids, trials: 1, maxCalls: 4,
26
+ yes: true, executor, judgeExecutor: null, runsRoot, runGroup: 'subset', log: () => { } };
27
+ await runEval({ ...base, dryRun: true, onPlan: plan => {
28
+ assert.equal(plan.plannedCalls, 4);
29
+ assert.deepEqual(plan.bench.taskIds, [...ids].reverse());
30
+ } });
31
+ assert.equal(calls, 0);
32
+ assert.ok(!existsSync(runsRoot));
33
+ const manifest = await runEval({ ...base, dryRun: false });
34
+ assert.ok(manifest && 'overall' in manifest);
35
+ assert.equal(calls, 4);
36
+ assert.equal(manifest.bench.taskCount, 2);
37
+ assert.ok(manifest.warnings.some(w => w.includes('indicative')));
38
+ const native = JSON.parse(readFileSync(join(runsRoot, 'subset/_plan.json'), 'utf8'));
39
+ assert.deepEqual(native.details.taskIds, [...ids].reverse());
40
+ const replay = await reportEvalComponent(join(runsRoot, 'subset'), { replay: true });
41
+ assert.ok('evidence' in replay && replay.evidence.verified);
42
+ assert.equal(calls, 4, 'replay must not call an executor');
43
+ });
44
+ test('invalid or over-budget selections stop before any executor or output starts', async (t) => {
45
+ const runsRoot = join(tmp(t, 'skillfit-selection-invalid-'), 'runs');
46
+ const task = loadBench(BUNDLED_CODE_REVIEW).tasks[0].id;
47
+ let calls = 0;
48
+ const executor = { describe: () => ({ kind: 'mock', model: 'offline' }), run: async () => { calls++; throw new Error('must not run'); } };
49
+ const base = { skillPath: makeSkill(t), bench: BUNDLED_CODE_REVIEW, trials: 1, yes: true,
50
+ dryRun: false, executor, judgeExecutor: null, runsRoot, log: () => { } };
51
+ for (const ids of [[], [task, task], ['absent'], ['../bad']]) {
52
+ await assert.rejects(() => runEval({ ...base, taskIds: ids }), /taskIds|Duplicate task|Unknown task/);
53
+ }
54
+ await assert.rejects(() => runEval({ ...base, taskIds: [task], maxCalls: 1 }), /exceeding/);
55
+ assert.equal(calls, 0);
56
+ assert.ok(!existsSync(runsRoot));
57
+ });
58
+ test('CLI repeatable task selectors preview only selected cases and reject duplicate IDs', t => {
59
+ const cli = fileURLToPath(new URL('../cli.js', import.meta.url));
60
+ const base = [cli, 'eval', makeSkill(t), '--bench', BUNDLED_CODE_REVIEW, '--agent', 'codex', '--trials', '1', '--dry-run'];
61
+ const result = spawnSync(process.execPath, [...base, '--task', 'review-r2', '--task', 'review-r1'], { encoding: 'utf8' });
62
+ assert.equal(result.status, 0, result.stderr);
63
+ assert.match(result.stdout, /2 task\(s\) × 2 conditions × 1 = 4 runs/);
64
+ assert.ok(result.stdout.indexOf('review-r1: fixture') < result.stdout.indexOf('review-r2: fixture'));
65
+ const invalid = spawnSync(process.execPath, [...base, '--task', 'review-r1', '--task', 'review-r1'], { encoding: 'utf8' });
66
+ assert.equal(invalid.status, 1);
67
+ assert.match(invalid.stderr, /Duplicate task/);
68
+ });
12
69
  function tmp(t, prefix) {
13
70
  const dir = mkdtempSync(join(tmpdir(), prefix));
14
71
  t.after(() => rmSync(dir, { recursive: true, force: true }));