@opensip-cli/simulation 0.1.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 (348) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/internal-surface.test.d.ts +9 -0
  5. package/dist/__tests__/internal-surface.test.d.ts.map +1 -0
  6. package/dist/__tests__/internal-surface.test.js +38 -0
  7. package/dist/__tests__/internal-surface.test.js.map +1 -0
  8. package/dist/__tests__/plugin-loader.test.d.ts +2 -0
  9. package/dist/__tests__/plugin-loader.test.d.ts.map +1 -0
  10. package/dist/__tests__/plugin-loader.test.js +64 -0
  11. package/dist/__tests__/plugin-loader.test.js.map +1 -0
  12. package/dist/__tests__/public-api.test.d.ts +15 -0
  13. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  14. package/dist/__tests__/public-api.test.js +73 -0
  15. package/dist/__tests__/public-api.test.js.map +1 -0
  16. package/dist/__tests__/registry-cross-kind.test.d.ts +6 -0
  17. package/dist/__tests__/registry-cross-kind.test.d.ts.map +1 -0
  18. package/dist/__tests__/registry-cross-kind.test.js +86 -0
  19. package/dist/__tests__/registry-cross-kind.test.js.map +1 -0
  20. package/dist/__tests__/scenario-execution.test.d.ts +10 -0
  21. package/dist/__tests__/scenario-execution.test.d.ts.map +1 -0
  22. package/dist/__tests__/scenario-execution.test.js +92 -0
  23. package/dist/__tests__/scenario-execution.test.js.map +1 -0
  24. package/dist/__tests__/sim-capability-contract.test.d.ts +10 -0
  25. package/dist/__tests__/sim-capability-contract.test.d.ts.map +1 -0
  26. package/dist/__tests__/sim-capability-contract.test.js +131 -0
  27. package/dist/__tests__/sim-capability-contract.test.js.map +1 -0
  28. package/dist/__tests__/sim-config-schema.test.d.ts +5 -0
  29. package/dist/__tests__/sim-config-schema.test.d.ts.map +1 -0
  30. package/dist/__tests__/sim-config-schema.test.js +23 -0
  31. package/dist/__tests__/sim-config-schema.test.js.map +1 -0
  32. package/dist/__tests__/sim-failure-signal.test.d.ts +10 -0
  33. package/dist/__tests__/sim-failure-signal.test.d.ts.map +1 -0
  34. package/dist/__tests__/sim-failure-signal.test.js +86 -0
  35. package/dist/__tests__/sim-failure-signal.test.js.map +1 -0
  36. package/dist/__tests__/surviving-surface-edges.test.d.ts +10 -0
  37. package/dist/__tests__/surviving-surface-edges.test.d.ts.map +1 -0
  38. package/dist/__tests__/surviving-surface-edges.test.js +122 -0
  39. package/dist/__tests__/surviving-surface-edges.test.js.map +1 -0
  40. package/dist/__tests__/test-utils/targets.d.ts +26 -0
  41. package/dist/__tests__/test-utils/targets.d.ts.map +1 -0
  42. package/dist/__tests__/test-utils/targets.js +38 -0
  43. package/dist/__tests__/test-utils/targets.js.map +1 -0
  44. package/dist/__tests__/test-utils/with-sim-scope.d.ts +12 -0
  45. package/dist/__tests__/test-utils/with-sim-scope.d.ts.map +1 -0
  46. package/dist/__tests__/test-utils/with-sim-scope.js +22 -0
  47. package/dist/__tests__/test-utils/with-sim-scope.js.map +1 -0
  48. package/dist/__tests__/tool-live-view.test.d.ts +20 -0
  49. package/dist/__tests__/tool-live-view.test.d.ts.map +1 -0
  50. package/dist/__tests__/tool-live-view.test.js +146 -0
  51. package/dist/__tests__/tool-live-view.test.js.map +1 -0
  52. package/dist/__tests__/tool-show-mode.test.d.ts +10 -0
  53. package/dist/__tests__/tool-show-mode.test.d.ts.map +1 -0
  54. package/dist/__tests__/tool-show-mode.test.js +156 -0
  55. package/dist/__tests__/tool-show-mode.test.js.map +1 -0
  56. package/dist/__tests__/tool.test.d.ts +15 -0
  57. package/dist/__tests__/tool.test.d.ts.map +1 -0
  58. package/dist/__tests__/tool.test.js +250 -0
  59. package/dist/__tests__/tool.test.js.map +1 -0
  60. package/dist/cli/__tests__/sim-config.test.d.ts +2 -0
  61. package/dist/cli/__tests__/sim-config.test.d.ts.map +1 -0
  62. package/dist/cli/__tests__/sim-config.test.js +94 -0
  63. package/dist/cli/__tests__/sim-config.test.js.map +1 -0
  64. package/dist/cli/__tests__/sim-runner.test.d.ts +23 -0
  65. package/dist/cli/__tests__/sim-runner.test.d.ts.map +1 -0
  66. package/dist/cli/__tests__/sim-runner.test.js +188 -0
  67. package/dist/cli/__tests__/sim-runner.test.js.map +1 -0
  68. package/dist/cli/__tests__/sim-worker.test.d.ts +12 -0
  69. package/dist/cli/__tests__/sim-worker.test.d.ts.map +1 -0
  70. package/dist/cli/__tests__/sim-worker.test.js +69 -0
  71. package/dist/cli/__tests__/sim-worker.test.js.map +1 -0
  72. package/dist/cli/__tests__/sim.test.d.ts +2 -0
  73. package/dist/cli/__tests__/sim.test.d.ts.map +1 -0
  74. package/dist/cli/__tests__/sim.test.js +232 -0
  75. package/dist/cli/__tests__/sim.test.js.map +1 -0
  76. package/dist/cli/sim-config-schema.d.ts +30 -0
  77. package/dist/cli/sim-config-schema.d.ts.map +1 -0
  78. package/dist/cli/sim-config-schema.js +33 -0
  79. package/dist/cli/sim-config-schema.js.map +1 -0
  80. package/dist/cli/sim-config.d.ts +22 -0
  81. package/dist/cli/sim-config.d.ts.map +1 -0
  82. package/dist/cli/sim-config.js +73 -0
  83. package/dist/cli/sim-config.js.map +1 -0
  84. package/dist/cli/sim-runner.d.ts +60 -0
  85. package/dist/cli/sim-runner.d.ts.map +1 -0
  86. package/dist/cli/sim-runner.js +175 -0
  87. package/dist/cli/sim-runner.js.map +1 -0
  88. package/dist/cli/sim-worker.d.ts +24 -0
  89. package/dist/cli/sim-worker.d.ts.map +1 -0
  90. package/dist/cli/sim-worker.js +65 -0
  91. package/dist/cli/sim-worker.js.map +1 -0
  92. package/dist/cli/sim.d.ts +56 -0
  93. package/dist/cli/sim.d.ts.map +1 -0
  94. package/dist/cli/sim.js +265 -0
  95. package/dist/cli/sim.js.map +1 -0
  96. package/dist/framework/__tests__/assertions.test.d.ts +2 -0
  97. package/dist/framework/__tests__/assertions.test.d.ts.map +1 -0
  98. package/dist/framework/__tests__/assertions.test.js +122 -0
  99. package/dist/framework/__tests__/assertions.test.js.map +1 -0
  100. package/dist/framework/__tests__/misc-coverage.test.d.ts +18 -0
  101. package/dist/framework/__tests__/misc-coverage.test.d.ts.map +1 -0
  102. package/dist/framework/__tests__/misc-coverage.test.js +142 -0
  103. package/dist/framework/__tests__/misc-coverage.test.js.map +1 -0
  104. package/dist/framework/__tests__/resolve-metric.test.d.ts +12 -0
  105. package/dist/framework/__tests__/resolve-metric.test.d.ts.map +1 -0
  106. package/dist/framework/__tests__/resolve-metric.test.js +124 -0
  107. package/dist/framework/__tests__/resolve-metric.test.js.map +1 -0
  108. package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
  109. package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
  110. package/dist/framework/__tests__/result-builder.test.js +180 -0
  111. package/dist/framework/__tests__/result-builder.test.js.map +1 -0
  112. package/dist/framework/__tests__/scenario-logger.test.d.ts +9 -0
  113. package/dist/framework/__tests__/scenario-logger.test.d.ts.map +1 -0
  114. package/dist/framework/__tests__/scenario-logger.test.js +110 -0
  115. package/dist/framework/__tests__/scenario-logger.test.js.map +1 -0
  116. package/dist/framework/__tests__/validation.test.d.ts +9 -0
  117. package/dist/framework/__tests__/validation.test.d.ts.map +1 -0
  118. package/dist/framework/__tests__/validation.test.js +126 -0
  119. package/dist/framework/__tests__/validation.test.js.map +1 -0
  120. package/dist/framework/assertions.d.ts +106 -0
  121. package/dist/framework/assertions.d.ts.map +1 -0
  122. package/dist/framework/assertions.js +256 -0
  123. package/dist/framework/assertions.js.map +1 -0
  124. package/dist/framework/execution/__tests__/execution-engine.test.d.ts +9 -0
  125. package/dist/framework/execution/__tests__/execution-engine.test.d.ts.map +1 -0
  126. package/dist/framework/execution/__tests__/execution-engine.test.js +138 -0
  127. package/dist/framework/execution/__tests__/execution-engine.test.js.map +1 -0
  128. package/dist/framework/execution/__tests__/fault-builders.test.d.ts +5 -0
  129. package/dist/framework/execution/__tests__/fault-builders.test.d.ts.map +1 -0
  130. package/dist/framework/execution/__tests__/fault-builders.test.js +23 -0
  131. package/dist/framework/execution/__tests__/fault-builders.test.js.map +1 -0
  132. package/dist/framework/execution/__tests__/fault-model.test.d.ts +6 -0
  133. package/dist/framework/execution/__tests__/fault-model.test.d.ts.map +1 -0
  134. package/dist/framework/execution/__tests__/fault-model.test.js +64 -0
  135. package/dist/framework/execution/__tests__/fault-model.test.js.map +1 -0
  136. package/dist/framework/execution/__tests__/http-target.test.d.ts +5 -0
  137. package/dist/framework/execution/__tests__/http-target.test.d.ts.map +1 -0
  138. package/dist/framework/execution/__tests__/http-target.test.js +36 -0
  139. package/dist/framework/execution/__tests__/http-target.test.js.map +1 -0
  140. package/dist/framework/execution/__tests__/run-load-window.test.d.ts +7 -0
  141. package/dist/framework/execution/__tests__/run-load-window.test.d.ts.map +1 -0
  142. package/dist/framework/execution/__tests__/run-load-window.test.js +89 -0
  143. package/dist/framework/execution/__tests__/run-load-window.test.js.map +1 -0
  144. package/dist/framework/execution/execution-engine.d.ts +55 -0
  145. package/dist/framework/execution/execution-engine.d.ts.map +1 -0
  146. package/dist/framework/execution/execution-engine.js +111 -0
  147. package/dist/framework/execution/execution-engine.js.map +1 -0
  148. package/dist/framework/execution/fault-builders.d.ts +26 -0
  149. package/dist/framework/execution/fault-builders.d.ts.map +1 -0
  150. package/dist/framework/execution/fault-builders.js +24 -0
  151. package/dist/framework/execution/fault-builders.js.map +1 -0
  152. package/dist/framework/execution/fault-model.d.ts +49 -0
  153. package/dist/framework/execution/fault-model.d.ts.map +1 -0
  154. package/dist/framework/execution/fault-model.js +108 -0
  155. package/dist/framework/execution/fault-model.js.map +1 -0
  156. package/dist/framework/execution/fault-spec.d.ts +40 -0
  157. package/dist/framework/execution/fault-spec.d.ts.map +1 -0
  158. package/dist/framework/execution/fault-spec.js +23 -0
  159. package/dist/framework/execution/fault-spec.js.map +1 -0
  160. package/dist/framework/execution/http-target.d.ts +34 -0
  161. package/dist/framework/execution/http-target.d.ts.map +1 -0
  162. package/dist/framework/execution/http-target.js +41 -0
  163. package/dist/framework/execution/http-target.js.map +1 -0
  164. package/dist/framework/execution/latency-tracker.d.ts +44 -0
  165. package/dist/framework/execution/latency-tracker.d.ts.map +1 -0
  166. package/dist/framework/execution/latency-tracker.js +76 -0
  167. package/dist/framework/execution/latency-tracker.js.map +1 -0
  168. package/dist/framework/execution/run-load-window.d.ts +45 -0
  169. package/dist/framework/execution/run-load-window.d.ts.map +1 -0
  170. package/dist/framework/execution/run-load-window.js +136 -0
  171. package/dist/framework/execution/run-load-window.js.map +1 -0
  172. package/dist/framework/execution/scenario-aborted-error.d.ts +14 -0
  173. package/dist/framework/execution/scenario-aborted-error.d.ts.map +1 -0
  174. package/dist/framework/execution/scenario-aborted-error.js +24 -0
  175. package/dist/framework/execution/scenario-aborted-error.js.map +1 -0
  176. package/dist/framework/execution/target.d.ts +35 -0
  177. package/dist/framework/execution/target.d.ts.map +1 -0
  178. package/dist/framework/execution/target.js +21 -0
  179. package/dist/framework/execution/target.js.map +1 -0
  180. package/dist/framework/registry.d.ts +67 -0
  181. package/dist/framework/registry.d.ts.map +1 -0
  182. package/dist/framework/registry.js +113 -0
  183. package/dist/framework/registry.js.map +1 -0
  184. package/dist/framework/resolve-metric.d.ts +79 -0
  185. package/dist/framework/resolve-metric.d.ts.map +1 -0
  186. package/dist/framework/resolve-metric.js +135 -0
  187. package/dist/framework/resolve-metric.js.map +1 -0
  188. package/dist/framework/result-builder.d.ts +72 -0
  189. package/dist/framework/result-builder.d.ts.map +1 -0
  190. package/dist/framework/result-builder.js +214 -0
  191. package/dist/framework/result-builder.js.map +1 -0
  192. package/dist/framework/result-renderers.d.ts +37 -0
  193. package/dist/framework/result-renderers.d.ts.map +1 -0
  194. package/dist/framework/result-renderers.js +62 -0
  195. package/dist/framework/result-renderers.js.map +1 -0
  196. package/dist/framework/runnable-scenario.d.ts +37 -0
  197. package/dist/framework/runnable-scenario.d.ts.map +1 -0
  198. package/dist/framework/runnable-scenario.js +9 -0
  199. package/dist/framework/runnable-scenario.js.map +1 -0
  200. package/dist/framework/scenario-executor-result.d.ts +44 -0
  201. package/dist/framework/scenario-executor-result.d.ts.map +1 -0
  202. package/dist/framework/scenario-executor-result.js +13 -0
  203. package/dist/framework/scenario-executor-result.js.map +1 -0
  204. package/dist/framework/scenario-logger.d.ts +18 -0
  205. package/dist/framework/scenario-logger.d.ts.map +1 -0
  206. package/dist/framework/scenario-logger.js +39 -0
  207. package/dist/framework/scenario-logger.js.map +1 -0
  208. package/dist/framework/scenario-metric-key.d.ts +24 -0
  209. package/dist/framework/scenario-metric-key.d.ts.map +1 -0
  210. package/dist/framework/scenario-metric-key.js +17 -0
  211. package/dist/framework/scenario-metric-key.js.map +1 -0
  212. package/dist/framework/validation.d.ts +83 -0
  213. package/dist/framework/validation.d.ts.map +1 -0
  214. package/dist/framework/validation.js +93 -0
  215. package/dist/framework/validation.js.map +1 -0
  216. package/dist/index.d.ts +35 -0
  217. package/dist/index.d.ts.map +1 -0
  218. package/dist/index.js +53 -0
  219. package/dist/index.js.map +1 -0
  220. package/dist/internal.d.ts +19 -0
  221. package/dist/internal.d.ts.map +1 -0
  222. package/dist/internal.js +16 -0
  223. package/dist/internal.js.map +1 -0
  224. package/dist/kinds/chaos/__tests__/executor.test.d.ts +6 -0
  225. package/dist/kinds/chaos/__tests__/executor.test.d.ts.map +1 -0
  226. package/dist/kinds/chaos/__tests__/executor.test.js +117 -0
  227. package/dist/kinds/chaos/__tests__/executor.test.js.map +1 -0
  228. package/dist/kinds/chaos/config.d.ts +48 -0
  229. package/dist/kinds/chaos/config.d.ts.map +1 -0
  230. package/dist/kinds/chaos/config.js +15 -0
  231. package/dist/kinds/chaos/config.js.map +1 -0
  232. package/dist/kinds/chaos/define.d.ts +32 -0
  233. package/dist/kinds/chaos/define.d.ts.map +1 -0
  234. package/dist/kinds/chaos/define.js +111 -0
  235. package/dist/kinds/chaos/define.js.map +1 -0
  236. package/dist/kinds/chaos/executor.d.ts +21 -0
  237. package/dist/kinds/chaos/executor.d.ts.map +1 -0
  238. package/dist/kinds/chaos/executor.js +107 -0
  239. package/dist/kinds/chaos/executor.js.map +1 -0
  240. package/dist/kinds/chaos/result.d.ts +43 -0
  241. package/dist/kinds/chaos/result.d.ts.map +1 -0
  242. package/dist/kinds/chaos/result.js +12 -0
  243. package/dist/kinds/chaos/result.js.map +1 -0
  244. package/dist/kinds/load/__tests__/executor.test.d.ts +6 -0
  245. package/dist/kinds/load/__tests__/executor.test.d.ts.map +1 -0
  246. package/dist/kinds/load/__tests__/executor.test.js +75 -0
  247. package/dist/kinds/load/__tests__/executor.test.js.map +1 -0
  248. package/dist/kinds/load/config.d.ts +30 -0
  249. package/dist/kinds/load/config.d.ts.map +1 -0
  250. package/dist/kinds/load/config.js +9 -0
  251. package/dist/kinds/load/config.js.map +1 -0
  252. package/dist/kinds/load/define.d.ts +47 -0
  253. package/dist/kinds/load/define.d.ts.map +1 -0
  254. package/dist/kinds/load/define.js +76 -0
  255. package/dist/kinds/load/define.js.map +1 -0
  256. package/dist/kinds/load/executor.d.ts +16 -0
  257. package/dist/kinds/load/executor.d.ts.map +1 -0
  258. package/dist/kinds/load/executor.js +90 -0
  259. package/dist/kinds/load/executor.js.map +1 -0
  260. package/dist/kinds/load/result.d.ts +21 -0
  261. package/dist/kinds/load/result.d.ts.map +1 -0
  262. package/dist/kinds/load/result.js +10 -0
  263. package/dist/kinds/load/result.js.map +1 -0
  264. package/dist/persistence/session-payload.d.ts +32 -0
  265. package/dist/persistence/session-payload.d.ts.map +1 -0
  266. package/dist/persistence/session-payload.js +46 -0
  267. package/dist/persistence/session-payload.js.map +1 -0
  268. package/dist/persistence/session-replay.d.ts +13 -0
  269. package/dist/persistence/session-replay.d.ts.map +1 -0
  270. package/dist/persistence/session-replay.js +76 -0
  271. package/dist/persistence/session-replay.js.map +1 -0
  272. package/dist/persistence/session-replay.test.d.ts +10 -0
  273. package/dist/persistence/session-replay.test.d.ts.map +1 -0
  274. package/dist/persistence/session-replay.test.js +169 -0
  275. package/dist/persistence/session-replay.test.js.map +1 -0
  276. package/dist/plugins/__tests__/loader-scenarios.test.d.ts +12 -0
  277. package/dist/plugins/__tests__/loader-scenarios.test.d.ts.map +1 -0
  278. package/dist/plugins/__tests__/loader-scenarios.test.js +61 -0
  279. package/dist/plugins/__tests__/loader-scenarios.test.js.map +1 -0
  280. package/dist/plugins/__tests__/scenario-package-discovery.test.d.ts +2 -0
  281. package/dist/plugins/__tests__/scenario-package-discovery.test.d.ts.map +1 -0
  282. package/dist/plugins/__tests__/scenario-package-discovery.test.js +43 -0
  283. package/dist/plugins/__tests__/scenario-package-discovery.test.js.map +1 -0
  284. package/dist/plugins/loader.d.ts +32 -0
  285. package/dist/plugins/loader.d.ts.map +1 -0
  286. package/dist/plugins/loader.js +119 -0
  287. package/dist/plugins/loader.js.map +1 -0
  288. package/dist/plugins/scenario-package-discovery.d.ts +23 -0
  289. package/dist/plugins/scenario-package-discovery.d.ts.map +1 -0
  290. package/dist/plugins/scenario-package-discovery.js +42 -0
  291. package/dist/plugins/scenario-package-discovery.js.map +1 -0
  292. package/dist/plugins/types.d.ts +24 -0
  293. package/dist/plugins/types.d.ts.map +1 -0
  294. package/dist/plugins/types.js +18 -0
  295. package/dist/plugins/types.js.map +1 -0
  296. package/dist/recipes/__tests__/recipes.test.d.ts +2 -0
  297. package/dist/recipes/__tests__/recipes.test.d.ts.map +1 -0
  298. package/dist/recipes/__tests__/recipes.test.js +515 -0
  299. package/dist/recipes/__tests__/recipes.test.js.map +1 -0
  300. package/dist/recipes/built-in-recipes.d.ts +16 -0
  301. package/dist/recipes/built-in-recipes.d.ts.map +1 -0
  302. package/dist/recipes/built-in-recipes.js +37 -0
  303. package/dist/recipes/built-in-recipes.js.map +1 -0
  304. package/dist/recipes/define-recipe.d.ts +29 -0
  305. package/dist/recipes/define-recipe.d.ts.map +1 -0
  306. package/dist/recipes/define-recipe.js +68 -0
  307. package/dist/recipes/define-recipe.js.map +1 -0
  308. package/dist/recipes/registry.d.ts +54 -0
  309. package/dist/recipes/registry.d.ts.map +1 -0
  310. package/dist/recipes/registry.js +89 -0
  311. package/dist/recipes/registry.js.map +1 -0
  312. package/dist/recipes/service.d.ts +61 -0
  313. package/dist/recipes/service.d.ts.map +1 -0
  314. package/dist/recipes/service.js +205 -0
  315. package/dist/recipes/service.js.map +1 -0
  316. package/dist/recipes/types.d.ts +62 -0
  317. package/dist/recipes/types.d.ts.map +1 -0
  318. package/dist/recipes/types.js +10 -0
  319. package/dist/recipes/types.js.map +1 -0
  320. package/dist/scaffold/examples.d.ts +22 -0
  321. package/dist/scaffold/examples.d.ts.map +1 -0
  322. package/dist/scaffold/examples.js +91 -0
  323. package/dist/scaffold/examples.js.map +1 -0
  324. package/dist/scope-augmentation.d.ts +70 -0
  325. package/dist/scope-augmentation.d.ts.map +1 -0
  326. package/dist/scope-augmentation.js +28 -0
  327. package/dist/scope-augmentation.js.map +1 -0
  328. package/dist/tool.d.ts +21 -0
  329. package/dist/tool.d.ts.map +1 -0
  330. package/dist/tool.js +347 -0
  331. package/dist/tool.js.map +1 -0
  332. package/dist/types/base-types.d.ts +35 -0
  333. package/dist/types/base-types.d.ts.map +1 -0
  334. package/dist/types/base-types.js +8 -0
  335. package/dist/types/base-types.js.map +1 -0
  336. package/dist/types/framework-types.d.ts +62 -0
  337. package/dist/types/framework-types.d.ts.map +1 -0
  338. package/dist/types/framework-types.js +15 -0
  339. package/dist/types/framework-types.js.map +1 -0
  340. package/dist/types/kind-types.d.ts +24 -0
  341. package/dist/types/kind-types.d.ts.map +1 -0
  342. package/dist/types/kind-types.js +22 -0
  343. package/dist/types/kind-types.js.map +1 -0
  344. package/dist/types/workload.d.ts +30 -0
  345. package/dist/types/workload.d.ts.map +1 -0
  346. package/dist/types/workload.js +20 -0
  347. package/dist/types/workload.js.map +1 -0
  348. package/package.json +120 -0
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview Built-in sim recipes.
3
+ *
4
+ * Currently only `default` ships built-in. Mirrors fitness's pattern:
5
+ * `opensip sim` (no flag) runs `default`, which selects all
6
+ * registered scenarios.
7
+ *
8
+ * Additional built-ins (e.g. `chaos-only`, `load-only`) can be added
9
+ * here when the surface earns it. Today, scenarios are sparse enough
10
+ * that one default is sufficient.
11
+ */
12
+ import type { SimulationRecipe } from './types.js';
13
+ export declare const builtInSimulationRecipes: readonly SimulationRecipe[];
14
+ export declare const builtInSimulationRecipesByName: Readonly<Record<string, SimulationRecipe>>;
15
+ export declare function isBuiltInSimulationRecipe(name: string): boolean;
16
+ //# sourceMappingURL=built-in-recipes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-recipes.d.ts","sourceRoot":"","sources":["../../src/recipes/built-in-recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAmBnD,eAAO,MAAM,wBAAwB,EAAE,SAAS,gBAAgB,EAAc,CAAC;AAE/E,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAErF,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview Built-in sim recipes.
3
+ *
4
+ * Currently only `default` ships built-in. Mirrors fitness's pattern:
5
+ * `opensip sim` (no flag) runs `default`, which selects all
6
+ * registered scenarios.
7
+ *
8
+ * Additional built-ins (e.g. `chaos-only`, `load-only`) can be added
9
+ * here when the surface earns it. Today, scenarios are sparse enough
10
+ * that one default is sufficient.
11
+ */
12
+ import { deriveRecipeId } from '@opensip-cli/core';
13
+ import { defineSimulationRecipe } from './define-recipe.js';
14
+ // Launch (§5.8): the built-in authors through the `defineSimulationRecipe`
15
+ // factory and derives its id via the shared `deriveRecipeId('BSCP', name)` scheme
16
+ // (`BSCP_default`, unchanged) — recipe-factory + id-scheme parity with fit/graph.
17
+ const DEFAULT = defineSimulationRecipe({
18
+ id: deriveRecipeId('BSCP', 'default'),
19
+ name: 'default',
20
+ displayName: 'Default',
21
+ description: 'Run all enabled scenarios in parallel',
22
+ scenarios: { type: 'all' },
23
+ execution: {
24
+ mode: 'parallel',
25
+ timeout: 60_000,
26
+ stopOnFirstFailure: false,
27
+ },
28
+ tags: ['default'],
29
+ });
30
+ export const builtInSimulationRecipes = [DEFAULT];
31
+ export const builtInSimulationRecipesByName = {
32
+ default: DEFAULT,
33
+ };
34
+ export function isBuiltInSimulationRecipe(name) {
35
+ return name in builtInSimulationRecipesByName;
36
+ }
37
+ //# sourceMappingURL=built-in-recipes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-recipes.js","sourceRoot":"","sources":["../../src/recipes/built-in-recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,2EAA2E;AAC3E,kFAAkF;AAClF,kFAAkF;AAClF,MAAM,OAAO,GAAqB,sBAAsB,CAAC;IACvD,EAAE,EAAE,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC;IACrC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,uCAAuC;IACpD,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC1B,SAAS,EAAE;QACT,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,kBAAkB,EAAE,KAAK;KAC1B;IACD,IAAI,EAAE,CAAC,SAAS,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAgC,CAAC,OAAO,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,8BAA8B,GAA+C;IACxF,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAY;IACpD,OAAO,IAAI,IAAI,8BAA8B,CAAC;AAChD,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @fileoverview `defineSimulationRecipe()` — author-facing factory.
3
+ *
4
+ * Returns a validated `SimulationRecipe` value. Registration is the
5
+ * plugin loader's responsibility — `defineSimulationRecipe` does NOT
6
+ * register the recipe as a side effect (mirrors what `defineXScenario`
7
+ * did in commit 1a0a71b; Item 1 closes the symmetry now that the
8
+ * simulation recipe registry is per-RunScope).
9
+ *
10
+ * User code authors recipes by exporting an array:
11
+ *
12
+ * export const recipes = [
13
+ * defineSimulationRecipe({ id: 'URCP_my', name: 'my', ... }),
14
+ * ];
15
+ *
16
+ * The plugin loader's `registerRecipesArray` iterates `recipes` and
17
+ * registers each into the current scope's `SimulationRecipeRegistry`.
18
+ */
19
+ import type { SimulationRecipe, SimulationRecipeConfig } from './types.js';
20
+ /**
21
+ * Define a sim recipe. Validates the config and returns the canonical
22
+ * `SimulationRecipe` value. Does NOT register the recipe — the plugin
23
+ * loader registers via the explicit `recipes: [...]` array channel.
24
+ *
25
+ * @throws ValidationError if `id` or `name` is missing, or if the
26
+ * selector / execution shape is invalid.
27
+ */
28
+ export declare function defineSimulationRecipe(config: SimulationRecipeConfig): SimulationRecipe;
29
+ //# sourceMappingURL=define-recipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-recipe.d.ts","sourceRoot":"","sources":["../../src/recipes/define-recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE3E;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB,CAwEvF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @fileoverview `defineSimulationRecipe()` — author-facing factory.
3
+ *
4
+ * Returns a validated `SimulationRecipe` value. Registration is the
5
+ * plugin loader's responsibility — `defineSimulationRecipe` does NOT
6
+ * register the recipe as a side effect (mirrors what `defineXScenario`
7
+ * did in commit 1a0a71b; Item 1 closes the symmetry now that the
8
+ * simulation recipe registry is per-RunScope).
9
+ *
10
+ * User code authors recipes by exporting an array:
11
+ *
12
+ * export const recipes = [
13
+ * defineSimulationRecipe({ id: 'URCP_my', name: 'my', ... }),
14
+ * ];
15
+ *
16
+ * The plugin loader's `registerRecipesArray` iterates `recipes` and
17
+ * registers each into the current scope's `SimulationRecipeRegistry`.
18
+ */
19
+ import { ValidationError } from '@opensip-cli/core';
20
+ /**
21
+ * Define a sim recipe. Validates the config and returns the canonical
22
+ * `SimulationRecipe` value. Does NOT register the recipe — the plugin
23
+ * loader registers via the explicit `recipes: [...]` array channel.
24
+ *
25
+ * @throws ValidationError if `id` or `name` is missing, or if the
26
+ * selector / execution shape is invalid.
27
+ */
28
+ export function defineSimulationRecipe(config) {
29
+ if (!config.id || typeof config.id !== 'string') {
30
+ throw new ValidationError('SimulationRecipe missing required `id`', {
31
+ code: 'VALIDATION.SIMULATION.RECIPE_ID_MISSING',
32
+ });
33
+ }
34
+ if (!config.name || typeof config.name !== 'string') {
35
+ throw new ValidationError(`SimulationRecipe '${config.id}' missing required \`name\``, {
36
+ code: 'VALIDATION.SIMULATION.RECIPE_NAME_MISSING',
37
+ });
38
+ }
39
+ if (!config.scenarios || typeof config.scenarios !== 'object') {
40
+ throw new ValidationError(`SimulationRecipe '${config.name}' missing required \`scenarios\` selector`, { code: 'VALIDATION.SIMULATION.RECIPE_SELECTOR_MISSING' });
41
+ }
42
+ if (!config.execution || typeof config.execution !== 'object') {
43
+ throw new ValidationError(`SimulationRecipe '${config.name}' missing required \`execution\` block`, { code: 'VALIDATION.SIMULATION.RECIPE_EXECUTION_MISSING' });
44
+ }
45
+ // Stronger validation for execution semantics (audit fix). Previously only
46
+ // checked "is object", allowing JS-authored recipes (and therefore plugin
47
+ // recipes) to pass garbage that scheduleUnits would misinterpret (unknown
48
+ // mode -> treated as parallel, NaN/negative concurrency or timeout, etc.).
49
+ const exec = config.execution;
50
+ if (exec.mode !== 'parallel' && exec.mode !== 'sequential') {
51
+ throw new ValidationError(`SimulationRecipe '${config.name}' execution.mode must be 'parallel' or 'sequential'`, { code: 'VALIDATION.SIMULATION.RECIPE_EXECUTION_INVALID_MODE' });
52
+ }
53
+ if (exec.timeout !== undefined &&
54
+ (!Number.isFinite(exec.timeout) || exec.timeout < 0)) {
55
+ throw new ValidationError(`SimulationRecipe '${config.name}' execution.timeout must be a non-negative finite number (or omitted)`, { code: 'VALIDATION.SIMULATION.RECIPE_EXECUTION_INVALID_TIMEOUT' });
56
+ }
57
+ if (exec.maxParallel !== undefined &&
58
+ (!Number.isFinite(exec.maxParallel) || exec.maxParallel < 1)) {
59
+ throw new ValidationError(`SimulationRecipe '${config.name}' execution.maxParallel must be a positive finite integer (or omitted)`, { code: 'VALIDATION.SIMULATION.RECIPE_EXECUTION_INVALID_MAX_PARALLEL' });
60
+ }
61
+ if (exec.stopOnFirstFailure !== undefined && typeof exec.stopOnFirstFailure !== 'boolean') {
62
+ throw new ValidationError(`SimulationRecipe '${config.name}' execution.stopOnFirstFailure must be a boolean (or omitted)`, {
63
+ code: 'VALIDATION.SIMULATION.RECIPE_EXECUTION_INVALID_STOP_ON_FIRST_FAILURE',
64
+ });
65
+ }
66
+ return config;
67
+ }
68
+ //# sourceMappingURL=define-recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-recipe.js","sourceRoot":"","sources":["../../src/recipes/define-recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA8B;IACnE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,IAAI,eAAe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,MAAM,IAAI,eAAe,CACvB,qBAAqB,MAAM,CAAC,IAAI,uEAAuE,EACvG,EAAE,IAAI,EAAE,wDAAwD,EAAE,CACnE,CAAC;IACJ,CAAC;IAED,IACE,IAAI,CAAC,WAAW,KAAK,SAAS;QAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAK,IAAI,CAAC,WAAsB,GAAG,CAAC,CAAC,EACxE,CAAC;QACD,MAAM,IAAI,eAAe,CACvB,qBAAqB,MAAM,CAAC,IAAI,wEAAwE,EACxG,EAAE,IAAI,EAAE,6DAA6D,EAAE,CACxE,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,IAAI,OAAO,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QAC1F,MAAM,IAAI,eAAe,CACvB,qBAAqB,MAAM,CAAC,IAAI,+DAA+D,EAC/F;YACE,IAAI,EAAE,sEAAsE;SAC7E,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @fileoverview Sim recipe registry — thin wrapper around the kernel's
3
+ * `RecipeRegistry<T>` (Layer 1 / core) that adds simulation-specific
4
+ * concerns: built-in recipe pre-registration with throw-on-duplicate
5
+ * semantics, and display info with `isBuiltIn` / `isUserDefined` flags.
6
+ *
7
+ * Per-RunScope: the simulation tool's `contributeScope` hook constructs a
8
+ * fresh `SimulationRecipeRegistry` per CLI invocation and attaches it
9
+ * to `scope.simulation.recipes` (Item 1 / D7). The module-level
10
+ * singleton is gone — consumers read via `currentSimulationRecipeRegistry()`
11
+ * which routes through the scope-bound instance.
12
+ *
13
+ * Built-in seeding goes through `registerAll(builtIns, { internal: true })`
14
+ * — the LSP-clean replacement for the prior direct-map-write pattern
15
+ * (the canonical T2 violation the runscope+registry plan resolves).
16
+ */
17
+ import { RecipeRegistry } from '@opensip-cli/core';
18
+ import type { SimulationRecipe } from './types.js';
19
+ /** Display-friendly summary of a registered recipe. */
20
+ export interface SimulationRecipeDisplayInfo {
21
+ readonly name: string;
22
+ readonly displayName: string;
23
+ readonly description: string;
24
+ readonly tags: readonly string[];
25
+ readonly isBuiltIn: boolean;
26
+ readonly isUserDefined: boolean;
27
+ }
28
+ /** Registry of simulation recipes — bootstraps built-ins and accepts user-defined additions. */
29
+ export declare class SimulationRecipeRegistry extends RecipeRegistry<SimulationRecipe> {
30
+ constructor();
31
+ /**
32
+ * Register a simulation recipe. Throws on duplicate id/name unless
33
+ * `allowOverwrite: true` is passed — historical contract preserved
34
+ * by routing through the kernel registry's `throwOnDuplicate` flag.
35
+ */
36
+ register(recipe: SimulationRecipe, options?: {
37
+ allowOverwrite?: boolean;
38
+ }): void;
39
+ reset(): void;
40
+ listForDisplay(): readonly SimulationRecipeDisplayInfo[];
41
+ }
42
+ /** Factory used by the simulation tool's `contributeScope` hook. */
43
+ export declare function createSimulationRecipeRegistry(): SimulationRecipeRegistry;
44
+ /**
45
+ * Read the current scope's simulation recipe registry. Throws when no
46
+ * scope is active or when the simulation subscope is missing — both
47
+ * indicate the caller is running outside the CLI's pre-action-hook (or
48
+ * the test fixture forgot to construct + enter a scope).
49
+ *
50
+ * @throws {Error} When called outside `runWithScope(...)`, or when the
51
+ * active scope has no simulation subscope.
52
+ */
53
+ export declare function currentSimulationRecipeRegistry(): SimulationRecipeRegistry;
54
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/recipes/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;AAIjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,uDAAuD;AACvD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAID,gGAAgG;AAChG,qBAAa,wBAAyB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;;IAW5E;;;;OAIG;IACM,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAOzF,KAAK,IAAI,IAAI;IAKb,cAAc,IAAI,SAAS,2BAA2B,EAAE;CAazD;AAED,oEAAoE;AACpE,wBAAgB,8BAA8B,IAAI,wBAAwB,CAEzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,IAAI,wBAAwB,CAmB1E"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @fileoverview Sim recipe registry — thin wrapper around the kernel's
3
+ * `RecipeRegistry<T>` (Layer 1 / core) that adds simulation-specific
4
+ * concerns: built-in recipe pre-registration with throw-on-duplicate
5
+ * semantics, and display info with `isBuiltIn` / `isUserDefined` flags.
6
+ *
7
+ * Per-RunScope: the simulation tool's `contributeScope` hook constructs a
8
+ * fresh `SimulationRecipeRegistry` per CLI invocation and attaches it
9
+ * to `scope.simulation.recipes` (Item 1 / D7). The module-level
10
+ * singleton is gone — consumers read via `currentSimulationRecipeRegistry()`
11
+ * which routes through the scope-bound instance.
12
+ *
13
+ * Built-in seeding goes through `registerAll(builtIns, { internal: true })`
14
+ * — the LSP-clean replacement for the prior direct-map-write pattern
15
+ * (the canonical T2 violation the runscope+registry plan resolves).
16
+ */
17
+ import { RecipeRegistry, currentScope } from '@opensip-cli/core';
18
+ import { builtInSimulationRecipes } from './built-in-recipes.js';
19
+ const BUILT_IN_NAMES = new Set(builtInSimulationRecipes.map((r) => r.name));
20
+ /** Registry of simulation recipes — bootstraps built-ins and accepts user-defined additions. */
21
+ export class SimulationRecipeRegistry extends RecipeRegistry {
22
+ constructor() {
23
+ super({
24
+ module: 'simulation:recipes',
25
+ validationCode: 'VALIDATION.SIMULATION.DUPLICATE_RECIPE',
26
+ });
27
+ // Built-ins bypass the duplicate guard via { internal: true } —
28
+ // replaces the prior direct map writes (the LSP violation).
29
+ this.registerAll(builtInSimulationRecipes, { internal: true });
30
+ }
31
+ /**
32
+ * Register a simulation recipe. Throws on duplicate id/name unless
33
+ * `allowOverwrite: true` is passed — historical contract preserved
34
+ * by routing through the kernel registry's `throwOnDuplicate` flag.
35
+ */
36
+ register(recipe, options) {
37
+ super.register(recipe, {
38
+ allowOverwrite: options?.allowOverwrite ?? false,
39
+ throwOnDuplicate: !(options?.allowOverwrite ?? false),
40
+ });
41
+ }
42
+ reset() {
43
+ this.clear();
44
+ this.registerAll(builtInSimulationRecipes, { internal: true });
45
+ }
46
+ listForDisplay() {
47
+ return this.getAllRecipes().map((recipe) => {
48
+ const isUser = recipe.id.startsWith('URCP_');
49
+ return {
50
+ name: recipe.name,
51
+ displayName: recipe.displayName,
52
+ description: recipe.description,
53
+ tags: recipe.tags ?? [],
54
+ isBuiltIn: !isUser && BUILT_IN_NAMES.has(recipe.name),
55
+ isUserDefined: isUser,
56
+ };
57
+ });
58
+ }
59
+ }
60
+ /** Factory used by the simulation tool's `contributeScope` hook. */
61
+ export function createSimulationRecipeRegistry() {
62
+ return new SimulationRecipeRegistry();
63
+ }
64
+ /**
65
+ * Read the current scope's simulation recipe registry. Throws when no
66
+ * scope is active or when the simulation subscope is missing — both
67
+ * indicate the caller is running outside the CLI's pre-action-hook (or
68
+ * the test fixture forgot to construct + enter a scope).
69
+ *
70
+ * @throws {Error} When called outside `runWithScope(...)`, or when the
71
+ * active scope has no simulation subscope.
72
+ */
73
+ export function currentSimulationRecipeRegistry() {
74
+ const scope = currentScope();
75
+ if (!scope) {
76
+ throw new Error('simulation: currentSimulationRecipeRegistry() called outside a RunScope. ' +
77
+ 'Wrap the call site in runWithScope (production: pre-action-hook handles ' +
78
+ 'this; tests: use makeTestScope + simulationTool.contributeScope or construct ' +
79
+ 'a registry directly).');
80
+ }
81
+ if (!scope.simulation) {
82
+ throw new Error('simulation: scope.simulation is missing. The simulation tool must be ' +
83
+ 'registered and its contributeScope hook must run before recipe reads. ' +
84
+ '(production: bootstrap registers simulationTool; tests: call ' +
85
+ 'simulationTool.contributeScope() after makeTestScope.)');
86
+ }
87
+ return scope.simulation.recipes;
88
+ }
89
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/recipes/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAcjE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE5E,gGAAgG;AAChG,MAAM,OAAO,wBAAyB,SAAQ,cAAgC;IAC5E;QACE,KAAK,CAAC;YACJ,MAAM,EAAE,oBAAoB;YAC5B,cAAc,EAAE,wCAAwC;SACzD,CAAC,CAAC;QACH,gEAAgE;QAChE,4DAA4D;QAC5D,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACM,QAAQ,CAAC,MAAwB,EAAE,OAAsC;QAChF,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;YACrB,cAAc,EAAE,OAAO,EAAE,cAAc,IAAI,KAAK;YAChD,gBAAgB,EAAE,CA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AAC,OAAO,CAAC;AAClC,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @fileoverview SimulationRecipeService — resolves a recipe to scenarios
3
+ * and runs them.
4
+ *
5
+ * The fitness recipe service is a much heavier orchestrator (file
6
+ * cache, AST parse cache, parallel scheduler, retry, callbacks). Sim
7
+ * doesn't have that surface yet — scenarios are self-contained and
8
+ * cheap. This service is intentionally minimal: pick scenarios, run
9
+ * them in the requested mode, return a result.
10
+ *
11
+ * Scope is the recipe-driven path. Direct `runScenario(scenario)`
12
+ * still exists in framework/ for callers that already have a
13
+ * RunnableScenario; recipes layer above that.
14
+ */
15
+ import type { SimulationRecipe } from './types.js';
16
+ import type { RunnableScenario } from '../framework/runnable-scenario.js';
17
+ import type { ScenarioExecutorResult } from '../framework/scenario-executor-result.js';
18
+ /** Per-scenario outcome inside a recipe run. */
19
+ export interface SimulationScenarioResult {
20
+ readonly scenarioId: string;
21
+ readonly scenarioName: string;
22
+ readonly kind: RunnableScenario['kind'];
23
+ readonly passed: boolean;
24
+ readonly durationMs: number;
25
+ readonly error?: string;
26
+ readonly result?: ScenarioExecutorResult;
27
+ }
28
+ /** Aggregate result of running a recipe. */
29
+ export interface SimulationRecipeResult {
30
+ readonly recipeName: string;
31
+ readonly recipeId: string;
32
+ readonly totalScenarios: number;
33
+ readonly passedScenarios: number;
34
+ readonly failedScenarios: number;
35
+ readonly scenarios: readonly SimulationScenarioResult[];
36
+ readonly durationMs: number;
37
+ }
38
+ /** Construction config for {@link SimulationRecipeService}: working directory, abort signal, and an optional live-progress callback. */
39
+ export interface SimulationRecipeServiceConfig {
40
+ readonly cwd?: string;
41
+ readonly abortSignal?: AbortSignal;
42
+ /**
43
+ * Optional live-progress callback (ADR-0016). Fired once with `(0, total)`
44
+ * before execution and then with a monotonic `(completed, total)` after each
45
+ * scenario finishes — across BOTH sequential and parallel modes. `total` is
46
+ * the recipe-selected set size. Count-shaped (not a renderer event)
47
+ * so the engine stays UI-agnostic; the sim runner maps it to ProgressEvents.
48
+ */
49
+ readonly onProgress?: (completed: number, total: number) => void;
50
+ }
51
+ /** Resolves a simulation recipe to its scenario set and runs them, returning an aggregate {@link SimulationRecipeResult}. */
52
+ export declare class SimulationRecipeService {
53
+ private readonly config;
54
+ constructor(config?: SimulationRecipeServiceConfig);
55
+ /**
56
+ * Run a recipe by resolving its scenario selector against the live
57
+ * scenario registry and executing the matched set.
58
+ */
59
+ runRecipe(recipe: SimulationRecipe): Promise<SimulationRecipeResult>;
60
+ }
61
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/recipes/service.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAYH,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wIAAwI;AACxI,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE;AAED,6HAA6H;AAC7H,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;gBAE3C,MAAM,GAAE,6BAAkC;IAItD;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAiD3E"}
@@ -0,0 +1,205 @@
1
+ // @fitness-ignore-file performance-anti-patterns -- sequential scenario execution preserves ordering and isolates per-scenario state; parallel execution belongs to load-window driver, not the recipe runner
2
+ /**
3
+ * @fileoverview SimulationRecipeService — resolves a recipe to scenarios
4
+ * and runs them.
5
+ *
6
+ * The fitness recipe service is a much heavier orchestrator (file
7
+ * cache, AST parse cache, parallel scheduler, retry, callbacks). Sim
8
+ * doesn't have that surface yet — scenarios are self-contained and
9
+ * cheap. This service is intentionally minimal: pick scenarios, run
10
+ * them in the requested mode, return a result.
11
+ *
12
+ * Scope is the recipe-driven path. Direct `runScenario(scenario)`
13
+ * still exists in framework/ for callers that already have a
14
+ * RunnableScenario; recipes layer above that.
15
+ */
16
+ import { logger, resolveSelector as resolveSelectorCore, runWithTimeout, scheduleUnits, } from '@opensip-cli/core';
17
+ import { currentScenarioRegistry } from '../framework/registry.js';
18
+ /** Resolves a simulation recipe to its scenario set and runs them, returning an aggregate {@link SimulationRecipeResult}. */
19
+ export class SimulationRecipeService {
20
+ config;
21
+ constructor(config = {}) {
22
+ this.config = config;
23
+ }
24
+ /**
25
+ * Run a recipe by resolving its scenario selector against the live
26
+ * scenario registry and executing the matched set.
27
+ */
28
+ async runRecipe(recipe) {
29
+ const startedAt = Date.now();
30
+ const selected = resolveSelector(recipe.scenarios);
31
+ logger.info({
32
+ evt: 'simulation.recipe.start',
33
+ module: 'simulation:recipes',
34
+ recipeName: recipe.name,
35
+ scenarioCount: selected.length,
36
+ });
37
+ // Live-progress (ADR-0016): emit a monotonic completed count across both
38
+ // execution modes. `++completed` is atomic in single-threaded JS, so the
39
+ // parallel pool's concurrent completions still produce a correct count.
40
+ const total = selected.length;
41
+ let completed = 0;
42
+ const { onProgress } = this.config;
43
+ onProgress?.(0, total);
44
+ const onComplete = onProgress
45
+ ? () => {
46
+ completed += 1;
47
+ onProgress(completed, total);
48
+ }
49
+ : undefined;
50
+ const results = await runScenarios(selected, recipe, this.config.abortSignal, onComplete);
51
+ const passedCount = results.filter((r) => r.passed).length;
52
+ const out = {
53
+ recipeName: recipe.name,
54
+ recipeId: recipe.id,
55
+ totalScenarios: results.length,
56
+ passedScenarios: passedCount,
57
+ failedScenarios: results.length - passedCount,
58
+ scenarios: results,
59
+ durationMs: Date.now() - startedAt,
60
+ };
61
+ logger.info({
62
+ evt: 'simulation.recipe.complete',
63
+ module: 'simulation:recipes',
64
+ recipeName: recipe.name,
65
+ passed: passedCount,
66
+ failed: results.length - passedCount,
67
+ durationMs: out.durationMs,
68
+ });
69
+ return out;
70
+ }
71
+ }
72
+ // =============================================================================
73
+ // SELECTOR RESOLUTION
74
+ // =============================================================================
75
+ /**
76
+ * Materialize a scenario selector against the registered scenarios.
77
+ *
78
+ * Returns the unique set of `RunnableScenario` objects matching the
79
+ * selector. Order is the registration order from the registry.
80
+ */
81
+ function resolveSelector(selector) {
82
+ const all = currentScenarioRegistry().getAll();
83
+ // Sim's selection semantics are id/name-literal everywhere (no glob, no
84
+ // per-unit config) and its `tags`/`kind` exclude on id/name rather than
85
+ // tags — all of which differ from core's tag/glob built-in arms. So sim
86
+ // supplies a predicate for every arm; core's role is the generic
87
+ // `items.filter(predicate)` dispatch plus the exhaustive-unknown guard,
88
+ // and it never has to name `ScenarioKind`. Registration order is preserved
89
+ // by `filter`, matching the previous hand-rolled switch byte-for-byte.
90
+ const opts = {
91
+ keysOf: (s) => [s.id, s.name],
92
+ tagsOf: (s) => s.tags,
93
+ predicates: {
94
+ all: (s, sel) => {
95
+ if (sel.type !== 'all')
96
+ return false;
97
+ const exclude = new Set(sel.exclude);
98
+ return !exclude.has(s.id) && !exclude.has(s.name);
99
+ },
100
+ explicit: (s, sel) => {
101
+ if (sel.type !== 'explicit')
102
+ return false;
103
+ const wanted = new Set(sel.scenarioIds);
104
+ return wanted.has(s.id) || wanted.has(s.name);
105
+ },
106
+ tags: (s, sel) => {
107
+ if (sel.type !== 'tags')
108
+ return false;
109
+ const include = new Set(sel.include);
110
+ const exclude = new Set(sel.exclude);
111
+ return s.tags.some((t) => include.has(t)) && !exclude.has(s.id) && !exclude.has(s.name);
112
+ },
113
+ kind: (s, sel) => {
114
+ if (sel.type !== 'kind')
115
+ return false;
116
+ const kinds = new Set(sel.kinds);
117
+ const exclude = new Set(sel.exclude);
118
+ return kinds.has(s.kind) && !exclude.has(s.id) && !exclude.has(s.name);
119
+ },
120
+ },
121
+ };
122
+ return resolveSelectorCore(selector, all, opts);
123
+ }
124
+ // =============================================================================
125
+ // EXECUTION (on the shared substrate, launch §5.8)
126
+ // =============================================================================
127
+ /**
128
+ * Sentinel timeout (the max `setTimeout` delay, ~24.8 days) used when a recipe
129
+ * declares no `execution.timeout` — preserving sim's historical "no timeout"
130
+ * behaviour while routing through the same substrate. A DECLARED timeout is
131
+ * enforced and aborts a runaway scenario (the §4.3 fix; previously the field was
132
+ * silently ignored).
133
+ */
134
+ const NO_TIMEOUT_MS = 2_147_483_647;
135
+ /** Effective concurrency: a positive bound below the set size, else run all at once. */
136
+ function effectiveMaxParallel(recipe, count) {
137
+ const limit = recipe.execution.maxParallel;
138
+ return limit !== undefined && limit > 0 && limit < count ? limit : count;
139
+ }
140
+ /**
141
+ * Run one scenario on the substrate: a declared `timeout` aborts a runaway run,
142
+ * and the timeout's signal is combined with the service-level abort so external
143
+ * cancellation still reaches an in-flight scenario. Maps the classified outcome to
144
+ * a `SimulationScenarioResult` — a timed-out scenario fails (it did not pass),
145
+ * exactly as a thrown error does.
146
+ */
147
+ async function runScenarioUnit(scenario, timeoutMs, abortSignal) {
148
+ const outcome = await runWithTimeout({
149
+ run: (timeoutSignal) => scenario.run(abortSignal ? AbortSignal.any([timeoutSignal, abortSignal]) : timeoutSignal),
150
+ timeoutMs,
151
+ });
152
+ const base = {
153
+ scenarioId: scenario.id,
154
+ scenarioName: scenario.name,
155
+ kind: scenario.kind,
156
+ durationMs: outcome.durationMs,
157
+ };
158
+ if (outcome.status === 'ok') {
159
+ // Propagate the executor's pass/fail verdict (assertions / kind predicates):
160
+ // a run that completed without throwing can still have failing assertions.
161
+ return { ...base, passed: outcome.result.passed, result: outcome.result };
162
+ }
163
+ let message;
164
+ if (outcome.status === 'timeout') {
165
+ message = `Scenario timed out after ${outcome.timeoutMs}ms`;
166
+ }
167
+ else {
168
+ message = outcome.error instanceof Error ? outcome.error.message : String(outcome.error);
169
+ }
170
+ logger.warn({
171
+ evt: 'simulation.scenario.failed',
172
+ module: 'simulation:recipes',
173
+ scenarioId: scenario.id,
174
+ error: message,
175
+ timedOut: outcome.status === 'timeout',
176
+ });
177
+ return { ...base, passed: false, error: message };
178
+ }
179
+ /**
180
+ * Run the selected scenarios through the shared scheduler (one loop for both
181
+ * modes). `maxParallel`/`stopOnFirstFailure` now mean the same thing they do in
182
+ * fitness — parallel mode honours `stopOnFirstFailure` (it previously ignored it).
183
+ * Results are written by array index so order is preserved across both modes.
184
+ */
185
+ async function runScenarios(scenarios, recipe, abortSignal, onComplete) {
186
+ const timeoutMs = recipe.execution.timeout ?? NO_TIMEOUT_MS;
187
+ const results = [];
188
+ await scheduleUnits({
189
+ units: scenarios,
190
+ mode: recipe.execution.mode,
191
+ maxParallel: effectiveMaxParallel(recipe, scenarios.length),
192
+ // Interim live-view smoothing (ADR-0028) — paint between scenarios on the
193
+ // in-process path; superseded for the live run by off-main-thread execution.
194
+ yieldBetweenUnits: true,
195
+ shouldAbort: () => abortSignal?.aborted === true,
196
+ runUnit: async (scenario, index) => {
197
+ const result = await runScenarioUnit(scenario, timeoutMs, abortSignal);
198
+ results[index] = result;
199
+ onComplete?.();
200
+ return { shouldStop: !result.passed && recipe.execution.stopOnFirstFailure === true };
201
+ },
202
+ });
203
+ return results.filter((r) => r !== undefined);
204
+ }
205
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/recipes/service.ts"],"names":[],"mappings":"AAAA,8MAA8M;AAC9M;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,MAAM,EACN,eAAe,IAAI,mBAAmB,EACtC,cAAc,EACd,aAAa,GAEd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AA0CnE,6HAA6H;AAC7H,MAAM,OAAO,uBAAuB;IACjB,MAAM,CAAgC;IAEvD,YAAY,SAAwC,EAAE;QACpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS,CAAC,MAAwB;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEnD,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,EAAE,yBAAyB;YAC9B,MAAM,EAAE,oBAAoB;YAC5B,UAAU,EAAE,MAAM,CAAC,IAAI;YACvB,aAAa,EAAE,QAAQ,CAAC,MAAM;SAC/B,CAAC,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