skillfit 0.9.0 → 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 (305) 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 +30 -13
  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.0-verification.json +38 -0
  268. package/docs/releases/0.9.0.md +20 -3
  269. package/docs/releases/0.9.1-first-publication.json +249 -0
  270. package/docs/releases/0.9.1-verification.json +122 -0
  271. package/docs/releases/0.9.1.md +65 -0
  272. package/docs/releases/trusted-publishing.md +114 -0
  273. package/docs/replay-packages.md +88 -0
  274. package/docs/schemas/bench-check.schema.json +109 -0
  275. package/docs/schemas/eval-request.schema.json +12 -0
  276. package/docs/sharing-results.md +6 -0
  277. package/docs/skill-evaluation-evidence.md +52 -0
  278. package/evidence/2026-10-15-diagnosing-receiver-correction.md +140 -0
  279. package/evidence/2026-10-15-independent-comparison-regression-stop.md +162 -0
  280. package/evidence/2026-10-15-independent-offline-readiness.md +144 -0
  281. package/evidence/2026-10-15-native-diff-mechanism.md +196 -0
  282. package/evidence/2026-10-15-receiver-mechanism-stop.md +154 -0
  283. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/README.md +35 -0
  284. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/expected.json +577 -0
  285. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/receiver-contract.test.mjs +138 -0
  286. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/replay.mjs +127 -0
  287. package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/verification.json +105 -0
  288. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/README.md +32 -0
  289. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/checks.json +32 -0
  290. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
  291. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/verification.json +25 -0
  292. package/evidence/artifacts/2026-10-15-independent-offline-readiness/README.md +17 -0
  293. package/evidence/artifacts/2026-10-15-independent-offline-readiness/verification.json +1548 -0
  294. package/evidence/artifacts/2026-10-15-native-diff-mechanism/README.md +48 -0
  295. package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
  296. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/README.md +38 -0
  297. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/checks.json +118 -0
  298. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
  299. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/verification.json +36 -0
  300. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/LICENSE +21 -0
  301. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/SKILL.md +51 -0
  302. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/agents/openai.yaml +3 -0
  303. package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/scripts/hitl-loop.template.sh +44 -0
  304. package/package.json +3 -3
  305. package/skills/skillfit/SKILL.md +17 -5
@@ -0,0 +1,577 @@
1
+ {
2
+ "kind": "skillfit.offline-receiver-correction",
3
+ "schemaVersion": 1,
4
+ "modelCalls": 0,
5
+ "extraScoredTasks": 0,
6
+ "independentValidation": false,
7
+ "skillBehaviorTested": false,
8
+ "automaticUpgrade": false,
9
+ "cumulativeCalls": 194,
10
+ "archiveSha256": "6a4d29e55a1b48b7e8cd4e790eb057341b08e92ede7e6fe903a015a6edfe3ed6",
11
+ "originalReplay": {
12
+ "receiverDiagnostic": true,
13
+ "modelCalls": 0,
14
+ "totalCalls": 12,
15
+ "newCalls": 11,
16
+ "regraded": 12,
17
+ "paired": 6,
18
+ "qualityCostsBudgetReplay": true,
19
+ "compositeNativeComponentAudit": false,
20
+ "derivedExport": true,
21
+ "decision": "reject",
22
+ "automaticUpgrade": false,
23
+ "cumulativeCalls": 194
24
+ },
25
+ "candidate": {
26
+ "sha256": "c369765671e8cd0ae88af9d34f160c0b5cb48bfb49eef933f6f52812673d8952",
27
+ "parentSha256": "db5e96d06d52f3c1fbfe4a10b12c999c6191dc6a42f889e074931730ff6eafa9",
28
+ "skillMdBeforeBytes": 2755,
29
+ "skillMdAfterBytes": 3074,
30
+ "addedBytes": 319,
31
+ "addedWhitespaceWords": 47,
32
+ "measuredModelTokenDelta": null,
33
+ "otherResourcesUnchanged": true
34
+ },
35
+ "receiverTestSha256": "23661fb62be42d707f567fd0f9686dd734f97467a9548831d7535efc7c3294f6",
36
+ "variants": [
37
+ {
38
+ "variant": "original",
39
+ "sourceSha256": "bb9f281fbbc8a6eb748c98435da0ca49fc3e0b5cdccfdffe30c9754e99977ad4",
40
+ "originalGeneratedTests": {
41
+ "passed": false,
42
+ "tests": 5,
43
+ "passing": 0,
44
+ "failing": [
45
+ [
46
+ "custom global timers preserve input resolve and clean up"
47
+ ],
48
+ [
49
+ "custom global timers preserve input reject and clean up"
50
+ ],
51
+ [
52
+ "custom global timers time out and cancel the input"
53
+ ],
54
+ [
55
+ "clear uses a compatible receiver and preserves later input resolution"
56
+ ],
57
+ [
58
+ "abort preserves its reason and clears a custom global timer"
59
+ ]
60
+ ]
61
+ },
62
+ "receiverContracts": {
63
+ "passed": false,
64
+ "tests": 18,
65
+ "passing": 8,
66
+ "failing": [
67
+ [
68
+ "strict-unbound: input resolve and cleanup"
69
+ ],
70
+ [
71
+ "strict-unbound: input reject and cleanup"
72
+ ],
73
+ [
74
+ "strict-unbound: timeout and input cancellation"
75
+ ],
76
+ [
77
+ "strict-unbound: explicit clear preserves later input"
78
+ ],
79
+ [
80
+ "strict-unbound: abort reason and cleanup"
81
+ ],
82
+ [
83
+ "foreign-realm: input resolve and cleanup"
84
+ ],
85
+ [
86
+ "foreign-realm: input reject and cleanup"
87
+ ],
88
+ [
89
+ "foreign-realm: timeout and input cancellation"
90
+ ],
91
+ [
92
+ "foreign-realm: explicit clear preserves later input"
93
+ ],
94
+ [
95
+ "foreign-realm: abort reason and cleanup"
96
+ ]
97
+ ]
98
+ },
99
+ "verifierWithCorrectedRegression": {
100
+ "passed": false,
101
+ "checks": [
102
+ {
103
+ "name": "Protected supplied assets and ordinary smoke behavior",
104
+ "pass": true
105
+ },
106
+ {
107
+ "name": "Scheduling does not bind this to the customTimers container",
108
+ "pass": false
109
+ },
110
+ {
111
+ "name": "Clearing does not bind this to that container",
112
+ "pass": false
113
+ },
114
+ {
115
+ "name": "Timeout and fallback paths keep their results",
116
+ "pass": true
117
+ },
118
+ {
119
+ "name": "Ordinary fulfillment and rejection keep identity",
120
+ "pass": true
121
+ },
122
+ {
123
+ "name": "Submitted regression passes the repair and complete functional upstream fix, and fails the original",
124
+ "pass": false
125
+ }
126
+ ],
127
+ "witnesses": []
128
+ }
129
+ },
130
+ {
131
+ "variant": "v4Delivery",
132
+ "sourceSha256": "dfab3e342fa631c840eea2322c8da22690c973423202b597c2fdfa7934a08335",
133
+ "originalGeneratedTests": {
134
+ "passed": true,
135
+ "tests": 5,
136
+ "passing": 5,
137
+ "failing": []
138
+ },
139
+ "receiverContracts": {
140
+ "passed": false,
141
+ "tests": 18,
142
+ "passing": 8,
143
+ "failing": [
144
+ [
145
+ "strict-unbound: input resolve and cleanup"
146
+ ],
147
+ [
148
+ "strict-unbound: input reject and cleanup"
149
+ ],
150
+ [
151
+ "strict-unbound: timeout and input cancellation"
152
+ ],
153
+ [
154
+ "strict-unbound: explicit clear preserves later input"
155
+ ],
156
+ [
157
+ "strict-unbound: abort reason and cleanup"
158
+ ],
159
+ [
160
+ "foreign-realm: input resolve and cleanup"
161
+ ],
162
+ [
163
+ "foreign-realm: input reject and cleanup"
164
+ ],
165
+ [
166
+ "foreign-realm: timeout and input cancellation"
167
+ ],
168
+ [
169
+ "foreign-realm: explicit clear preserves later input"
170
+ ],
171
+ [
172
+ "foreign-realm: abort reason and cleanup"
173
+ ]
174
+ ]
175
+ },
176
+ "verifierWithCorrectedRegression": {
177
+ "passed": false,
178
+ "checks": [
179
+ {
180
+ "name": "Protected supplied assets and ordinary smoke behavior",
181
+ "pass": true
182
+ },
183
+ {
184
+ "name": "Scheduling does not bind this to the customTimers container",
185
+ "pass": false
186
+ },
187
+ {
188
+ "name": "Clearing does not bind this to that container",
189
+ "pass": false
190
+ },
191
+ {
192
+ "name": "Timeout and fallback paths keep their results",
193
+ "pass": true
194
+ },
195
+ {
196
+ "name": "Ordinary fulfillment and rejection keep identity",
197
+ "pass": true
198
+ },
199
+ {
200
+ "name": "Submitted regression passes the repair and complete functional upstream fix, and fails the original",
201
+ "pass": false
202
+ }
203
+ ],
204
+ "witnesses": []
205
+ }
206
+ },
207
+ {
208
+ "variant": "baselineDelivery",
209
+ "sourceSha256": "847777264a2711794a4193e77e61723372f8abdc3d26e0cbc806f6e3e4481940",
210
+ "originalGeneratedTests": {
211
+ "passed": false,
212
+ "tests": 5,
213
+ "passing": 0,
214
+ "failing": [
215
+ [
216
+ "custom global timers preserve input resolve and clean up"
217
+ ],
218
+ [
219
+ "custom global timers preserve input reject and clean up"
220
+ ],
221
+ [
222
+ "custom global timers time out and cancel the input"
223
+ ],
224
+ [
225
+ "clear uses a compatible receiver and preserves later input resolution"
226
+ ],
227
+ [
228
+ "abort preserves its reason and clears a custom global timer"
229
+ ]
230
+ ]
231
+ },
232
+ "receiverContracts": {
233
+ "passed": true,
234
+ "tests": 18,
235
+ "passing": 18,
236
+ "failing": []
237
+ },
238
+ "verifierWithCorrectedRegression": {
239
+ "passed": true,
240
+ "checks": [
241
+ {
242
+ "name": "Protected supplied assets and ordinary smoke behavior",
243
+ "pass": true
244
+ },
245
+ {
246
+ "name": "Scheduling does not bind this to the customTimers container",
247
+ "pass": true
248
+ },
249
+ {
250
+ "name": "Clearing does not bind this to that container",
251
+ "pass": true
252
+ },
253
+ {
254
+ "name": "Timeout and fallback paths keep their results",
255
+ "pass": true
256
+ },
257
+ {
258
+ "name": "Ordinary fulfillment and rejection keep identity",
259
+ "pass": true
260
+ },
261
+ {
262
+ "name": "Submitted regression passes the repair and complete functional upstream fix, and fails the original",
263
+ "pass": true
264
+ }
265
+ ],
266
+ "witnesses": [
267
+ {
268
+ "file": "receiver-contract.test.mjs",
269
+ "path": [
270
+ "strict-unbound: input resolve and cleanup"
271
+ ]
272
+ },
273
+ {
274
+ "file": "receiver-contract.test.mjs",
275
+ "path": [
276
+ "strict-unbound: input reject and cleanup"
277
+ ]
278
+ },
279
+ {
280
+ "file": "receiver-contract.test.mjs",
281
+ "path": [
282
+ "strict-unbound: timeout and input cancellation"
283
+ ]
284
+ },
285
+ {
286
+ "file": "receiver-contract.test.mjs",
287
+ "path": [
288
+ "strict-unbound: explicit clear preserves later input"
289
+ ]
290
+ },
291
+ {
292
+ "file": "receiver-contract.test.mjs",
293
+ "path": [
294
+ "strict-unbound: abort reason and cleanup"
295
+ ]
296
+ },
297
+ {
298
+ "file": "receiver-contract.test.mjs",
299
+ "path": [
300
+ "foreign-realm: input resolve and cleanup"
301
+ ]
302
+ },
303
+ {
304
+ "file": "receiver-contract.test.mjs",
305
+ "path": [
306
+ "foreign-realm: input reject and cleanup"
307
+ ]
308
+ },
309
+ {
310
+ "file": "receiver-contract.test.mjs",
311
+ "path": [
312
+ "foreign-realm: timeout and input cancellation"
313
+ ]
314
+ },
315
+ {
316
+ "file": "receiver-contract.test.mjs",
317
+ "path": [
318
+ "foreign-realm: explicit clear preserves later input"
319
+ ]
320
+ },
321
+ {
322
+ "file": "receiver-contract.test.mjs",
323
+ "path": [
324
+ "foreign-realm: abort reason and cleanup"
325
+ ]
326
+ }
327
+ ]
328
+ }
329
+ },
330
+ {
331
+ "variant": "maintainer",
332
+ "sourceSha256": "abf97d3629c06bbff31aa73162440032b63baf746e9d2570539c03d43ff2c0fa",
333
+ "originalGeneratedTests": {
334
+ "passed": false,
335
+ "tests": 5,
336
+ "passing": 0,
337
+ "failing": [
338
+ [
339
+ "custom global timers preserve input resolve and clean up"
340
+ ],
341
+ [
342
+ "custom global timers preserve input reject and clean up"
343
+ ],
344
+ [
345
+ "custom global timers time out and cancel the input"
346
+ ],
347
+ [
348
+ "clear uses a compatible receiver and preserves later input resolution"
349
+ ],
350
+ [
351
+ "abort preserves its reason and clears a custom global timer"
352
+ ]
353
+ ]
354
+ },
355
+ "receiverContracts": {
356
+ "passed": true,
357
+ "tests": 18,
358
+ "passing": 18,
359
+ "failing": []
360
+ },
361
+ "verifierWithCorrectedRegression": {
362
+ "passed": true,
363
+ "checks": [
364
+ {
365
+ "name": "Protected supplied assets and ordinary smoke behavior",
366
+ "pass": true
367
+ },
368
+ {
369
+ "name": "Scheduling does not bind this to the customTimers container",
370
+ "pass": true
371
+ },
372
+ {
373
+ "name": "Clearing does not bind this to that container",
374
+ "pass": true
375
+ },
376
+ {
377
+ "name": "Timeout and fallback paths keep their results",
378
+ "pass": true
379
+ },
380
+ {
381
+ "name": "Ordinary fulfillment and rejection keep identity",
382
+ "pass": true
383
+ },
384
+ {
385
+ "name": "Submitted regression passes the repair and complete functional upstream fix, and fails the original",
386
+ "pass": true
387
+ }
388
+ ],
389
+ "witnesses": [
390
+ {
391
+ "file": "receiver-contract.test.mjs",
392
+ "path": [
393
+ "strict-unbound: input resolve and cleanup"
394
+ ]
395
+ },
396
+ {
397
+ "file": "receiver-contract.test.mjs",
398
+ "path": [
399
+ "strict-unbound: input reject and cleanup"
400
+ ]
401
+ },
402
+ {
403
+ "file": "receiver-contract.test.mjs",
404
+ "path": [
405
+ "strict-unbound: timeout and input cancellation"
406
+ ]
407
+ },
408
+ {
409
+ "file": "receiver-contract.test.mjs",
410
+ "path": [
411
+ "strict-unbound: explicit clear preserves later input"
412
+ ]
413
+ },
414
+ {
415
+ "file": "receiver-contract.test.mjs",
416
+ "path": [
417
+ "strict-unbound: abort reason and cleanup"
418
+ ]
419
+ },
420
+ {
421
+ "file": "receiver-contract.test.mjs",
422
+ "path": [
423
+ "foreign-realm: input resolve and cleanup"
424
+ ]
425
+ },
426
+ {
427
+ "file": "receiver-contract.test.mjs",
428
+ "path": [
429
+ "foreign-realm: input reject and cleanup"
430
+ ]
431
+ },
432
+ {
433
+ "file": "receiver-contract.test.mjs",
434
+ "path": [
435
+ "foreign-realm: timeout and input cancellation"
436
+ ]
437
+ },
438
+ {
439
+ "file": "receiver-contract.test.mjs",
440
+ "path": [
441
+ "foreign-realm: explicit clear preserves later input"
442
+ ]
443
+ },
444
+ {
445
+ "file": "receiver-contract.test.mjs",
446
+ "path": [
447
+ "foreign-realm: abort reason and cleanup"
448
+ ]
449
+ }
450
+ ]
451
+ }
452
+ },
453
+ {
454
+ "variant": "manualRepair",
455
+ "sourceSha256": "2596d753076595741c4f9fb1942762e5f1faa31a650c2aac01a88c7984884c8e",
456
+ "originalGeneratedTests": {
457
+ "passed": false,
458
+ "tests": 5,
459
+ "passing": 0,
460
+ "failing": [
461
+ [
462
+ "custom global timers preserve input resolve and clean up"
463
+ ],
464
+ [
465
+ "custom global timers preserve input reject and clean up"
466
+ ],
467
+ [
468
+ "custom global timers time out and cancel the input"
469
+ ],
470
+ [
471
+ "clear uses a compatible receiver and preserves later input resolution"
472
+ ],
473
+ [
474
+ "abort preserves its reason and clears a custom global timer"
475
+ ]
476
+ ]
477
+ },
478
+ "receiverContracts": {
479
+ "passed": true,
480
+ "tests": 18,
481
+ "passing": 18,
482
+ "failing": []
483
+ },
484
+ "verifierWithCorrectedRegression": {
485
+ "passed": true,
486
+ "checks": [
487
+ {
488
+ "name": "Protected supplied assets and ordinary smoke behavior",
489
+ "pass": true
490
+ },
491
+ {
492
+ "name": "Scheduling does not bind this to the customTimers container",
493
+ "pass": true
494
+ },
495
+ {
496
+ "name": "Clearing does not bind this to that container",
497
+ "pass": true
498
+ },
499
+ {
500
+ "name": "Timeout and fallback paths keep their results",
501
+ "pass": true
502
+ },
503
+ {
504
+ "name": "Ordinary fulfillment and rejection keep identity",
505
+ "pass": true
506
+ },
507
+ {
508
+ "name": "Submitted regression passes the repair and complete functional upstream fix, and fails the original",
509
+ "pass": true
510
+ }
511
+ ],
512
+ "witnesses": [
513
+ {
514
+ "file": "receiver-contract.test.mjs",
515
+ "path": [
516
+ "strict-unbound: input resolve and cleanup"
517
+ ]
518
+ },
519
+ {
520
+ "file": "receiver-contract.test.mjs",
521
+ "path": [
522
+ "strict-unbound: input reject and cleanup"
523
+ ]
524
+ },
525
+ {
526
+ "file": "receiver-contract.test.mjs",
527
+ "path": [
528
+ "strict-unbound: timeout and input cancellation"
529
+ ]
530
+ },
531
+ {
532
+ "file": "receiver-contract.test.mjs",
533
+ "path": [
534
+ "strict-unbound: explicit clear preserves later input"
535
+ ]
536
+ },
537
+ {
538
+ "file": "receiver-contract.test.mjs",
539
+ "path": [
540
+ "strict-unbound: abort reason and cleanup"
541
+ ]
542
+ },
543
+ {
544
+ "file": "receiver-contract.test.mjs",
545
+ "path": [
546
+ "foreign-realm: input resolve and cleanup"
547
+ ]
548
+ },
549
+ {
550
+ "file": "receiver-contract.test.mjs",
551
+ "path": [
552
+ "foreign-realm: input reject and cleanup"
553
+ ]
554
+ },
555
+ {
556
+ "file": "receiver-contract.test.mjs",
557
+ "path": [
558
+ "foreign-realm: timeout and input cancellation"
559
+ ]
560
+ },
561
+ {
562
+ "file": "receiver-contract.test.mjs",
563
+ "path": [
564
+ "foreign-realm: explicit clear preserves later input"
565
+ ]
566
+ },
567
+ {
568
+ "file": "receiver-contract.test.mjs",
569
+ "path": [
570
+ "foreign-realm: abort reason and cleanup"
571
+ ]
572
+ }
573
+ ]
574
+ }
575
+ }
576
+ ]
577
+ }
@@ -0,0 +1,138 @@
1
+ // Post-result development probes. Not an independent task or a Skill efficacy test.
2
+ import test from 'node:test';
3
+ import assert from 'node:assert/strict';
4
+ import {createContext, runInContext} from 'node:vm';
5
+ import pTimeout, {TimeoutError} from './index.js';
6
+
7
+ function createTimers(kind) {
8
+ const scheduled = [];
9
+ const cleared = [];
10
+ const pending = new Set();
11
+ const schedule = (callback, milliseconds) => {
12
+ const handle = {callback, milliseconds};
13
+ scheduled.push(handle);
14
+ pending.add(handle);
15
+ return handle;
16
+ };
17
+ const cancel = handle => {
18
+ cleared.push(handle);
19
+ pending.delete(handle);
20
+ };
21
+ let customTimers;
22
+ if (kind === 'strict-unbound') {
23
+ customTimers = {
24
+ setTimeout: function (...args) {
25
+ assert.equal(this, undefined);
26
+ return schedule(...args);
27
+ },
28
+ clearTimeout: function (...args) {
29
+ assert.equal(this, undefined);
30
+ return cancel(...args);
31
+ },
32
+ };
33
+ } else if (kind === 'foreign-realm') {
34
+ // These ordinary non-strict functions establish their own default receiver.
35
+ customTimers = runInContext(`({
36
+ setTimeout: function (...args) {
37
+ if (this !== globalThis) throw new TypeError('incompatible scheduling receiver');
38
+ return schedule(...args);
39
+ },
40
+ clearTimeout: function (...args) {
41
+ if (this !== globalThis) throw new TypeError('incompatible clearing receiver');
42
+ return cancel(...args);
43
+ }
44
+ })`, createContext({schedule, cancel}));
45
+ } else {
46
+ assert.equal(kind, 'prebound-owner');
47
+ const owner = {};
48
+ customTimers = {
49
+ setTimeout: function (...args) {
50
+ assert.equal(this, owner);
51
+ return schedule(...args);
52
+ }.bind(owner),
53
+ clearTimeout: function (...args) {
54
+ assert.equal(this, owner);
55
+ return cancel(...args);
56
+ }.bind(owner),
57
+ };
58
+ }
59
+ return {
60
+ customTimers, scheduled, cleared,
61
+ fire() {
62
+ const handles = [...pending];
63
+ for (const handle of handles) {
64
+ pending.delete(handle);
65
+ handle.callback();
66
+ }
67
+ return handles.length;
68
+ },
69
+ };
70
+ }
71
+
72
+ for (const kind of ['strict-unbound', 'foreign-realm', 'prebound-owner']) {
73
+ test(`${kind}: supplied functions work independently of pTimeout`, () => {
74
+ const timers = createTimers(kind);
75
+ const {setTimeout, clearTimeout} = timers.customTimers;
76
+ const handle = setTimeout(() => assert.fail('cancelled'), 25);
77
+ clearTimeout(handle);
78
+ assert.deepEqual(timers.cleared, [handle]);
79
+ assert.equal(timers.fire(), 0);
80
+ });
81
+ for (const outcome of ['resolve', 'reject']) {
82
+ test(`${kind}: input ${outcome} and cleanup`, {timeout: 1000}, async () => {
83
+ const timers = createTimers(kind);
84
+ const value = {answer: 42};
85
+ const source = outcome === 'resolve' ? Promise.resolve(value) : Promise.reject(value);
86
+ const wrapped = pTimeout(source, {milliseconds: 25, customTimers: timers.customTimers});
87
+ if (outcome === 'resolve') assert.equal(await wrapped, value);
88
+ else await assert.rejects(wrapped, error => error === value);
89
+ assert.equal(timers.scheduled.length, 1);
90
+ assert.equal(timers.scheduled[0].milliseconds, 25);
91
+ assert.deepEqual(timers.cleared, [timers.scheduled[0]]);
92
+ assert.equal(timers.fire(), 0);
93
+ });
94
+ }
95
+ test(`${kind}: timeout and input cancellation`, {timeout: 1000}, async () => {
96
+ const timers = createTimers(kind);
97
+ const source = new Promise(() => {});
98
+ let cancellations = 0;
99
+ source.cancel = function () { assert.equal(this, source); cancellations++; };
100
+ const wrapped = pTimeout(source, {milliseconds: 25, customTimers: timers.customTimers});
101
+ const rejected = assert.rejects(wrapped, error => {
102
+ assert.ok(error instanceof TimeoutError);
103
+ assert.equal(error.message, 'Promise timed out after 25 milliseconds');
104
+ return true;
105
+ });
106
+ const fired = timers.fire();
107
+ await rejected;
108
+ assert.equal(fired, 1);
109
+ assert.equal(cancellations, 1);
110
+ assert.deepEqual(timers.cleared, [timers.scheduled[0]]);
111
+ });
112
+ test(`${kind}: explicit clear preserves later input`, {timeout: 1000}, async () => {
113
+ const timers = createTimers(kind);
114
+ let release;
115
+ const source = new Promise(resolve => { release = resolve; });
116
+ const wrapped = pTimeout(source, {milliseconds: 25, customTimers: timers.customTimers});
117
+ const result = wrapped.then(value => ({value}), error => ({error}));
118
+ assert.equal(wrapped.clear(), undefined);
119
+ assert.deepEqual(timers.cleared, [timers.scheduled[0]]);
120
+ assert.equal(timers.fire(), 0);
121
+ const value = {answer: 42};
122
+ release(value);
123
+ assert.deepEqual(await result, {value});
124
+ });
125
+ test(`${kind}: abort reason and cleanup`, {timeout: 1000}, async () => {
126
+ const timers = createTimers(kind);
127
+ const controller = new AbortController();
128
+ const reason = new Error('stop');
129
+ const wrapped = pTimeout(new Promise(() => {}), {
130
+ milliseconds: 25, customTimers: timers.customTimers, signal: controller.signal,
131
+ });
132
+ const rejected = assert.rejects(wrapped, error => error === reason);
133
+ controller.abort(reason);
134
+ await rejected;
135
+ assert.deepEqual(timers.cleared, [timers.scheduled[0]]);
136
+ assert.equal(timers.fire(), 0);
137
+ });
138
+ }