@substrate-ai/factory 0.19.54 → 0.20.2

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 (491) hide show
  1. package/README.md +39 -0
  2. package/dist/config.d.ts +4 -4
  3. package/package.json +12 -3
  4. package/dist/__tests__/config.test.d.ts +0 -11
  5. package/dist/__tests__/config.test.d.ts.map +0 -1
  6. package/dist/__tests__/config.test.js +0 -215
  7. package/dist/__tests__/config.test.js.map +0 -1
  8. package/dist/__tests__/factory-run-command.test.d.ts +0 -12
  9. package/dist/__tests__/factory-run-command.test.d.ts.map +0 -1
  10. package/dist/__tests__/factory-run-command.test.js +0 -454
  11. package/dist/__tests__/factory-run-command.test.js.map +0 -1
  12. package/dist/__tests__/factory-validate-command.test.d.ts +0 -15
  13. package/dist/__tests__/factory-validate-command.test.d.ts.map +0 -1
  14. package/dist/__tests__/factory-validate-command.test.js +0 -339
  15. package/dist/__tests__/factory-validate-command.test.js.map +0 -1
  16. package/dist/__tests__/fixtures/advanced-cross-project-validation.dot.d.ts +0 -72
  17. package/dist/__tests__/fixtures/advanced-cross-project-validation.dot.d.ts.map +0 -1
  18. package/dist/__tests__/fixtures/advanced-cross-project-validation.dot.js +0 -121
  19. package/dist/__tests__/fixtures/advanced-cross-project-validation.dot.js.map +0 -1
  20. package/dist/__tests__/fixtures/llm-edge-routing.dot.d.ts +0 -28
  21. package/dist/__tests__/fixtures/llm-edge-routing.dot.d.ts.map +0 -1
  22. package/dist/__tests__/fixtures/llm-edge-routing.dot.js +0 -55
  23. package/dist/__tests__/fixtures/llm-edge-routing.dot.js.map +0 -1
  24. package/dist/__tests__/fixtures/manager-loop.dot.d.ts +0 -34
  25. package/dist/__tests__/fixtures/manager-loop.dot.d.ts.map +0 -1
  26. package/dist/__tests__/fixtures/manager-loop.dot.js +0 -61
  27. package/dist/__tests__/fixtures/manager-loop.dot.js.map +0 -1
  28. package/dist/__tests__/fixtures/parallel-fan-out-fan-in.dot.d.ts +0 -42
  29. package/dist/__tests__/fixtures/parallel-fan-out-fan-in.dot.d.ts.map +0 -1
  30. package/dist/__tests__/fixtures/parallel-fan-out-fan-in.dot.js +0 -118
  31. package/dist/__tests__/fixtures/parallel-fan-out-fan-in.dot.js.map +0 -1
  32. package/dist/__tests__/fixtures/subgraph-parent.dot.d.ts +0 -35
  33. package/dist/__tests__/fixtures/subgraph-parent.dot.d.ts.map +0 -1
  34. package/dist/__tests__/fixtures/subgraph-parent.dot.js +0 -69
  35. package/dist/__tests__/fixtures/subgraph-parent.dot.js.map +0 -1
  36. package/dist/__tests__/integration/advanced-graph-events.test.d.ts +0 -19
  37. package/dist/__tests__/integration/advanced-graph-events.test.d.ts.map +0 -1
  38. package/dist/__tests__/integration/advanced-graph-events.test.js +0 -288
  39. package/dist/__tests__/integration/advanced-graph-events.test.js.map +0 -1
  40. package/dist/__tests__/integration/checkpoint-resume.test.d.ts +0 -10
  41. package/dist/__tests__/integration/checkpoint-resume.test.d.ts.map +0 -1
  42. package/dist/__tests__/integration/checkpoint-resume.test.js +0 -125
  43. package/dist/__tests__/integration/checkpoint-resume.test.js.map +0 -1
  44. package/dist/__tests__/integration/conditional-pipeline.test.d.ts +0 -10
  45. package/dist/__tests__/integration/conditional-pipeline.test.d.ts.map +0 -1
  46. package/dist/__tests__/integration/conditional-pipeline.test.js +0 -106
  47. package/dist/__tests__/integration/conditional-pipeline.test.js.map +0 -1
  48. package/dist/__tests__/integration/convergence-validation.test.d.ts +0 -14
  49. package/dist/__tests__/integration/convergence-validation.test.d.ts.map +0 -1
  50. package/dist/__tests__/integration/convergence-validation.test.js +0 -449
  51. package/dist/__tests__/integration/convergence-validation.test.js.map +0 -1
  52. package/dist/__tests__/integration/epic44-coverage-gate.test.d.ts +0 -12
  53. package/dist/__tests__/integration/epic44-coverage-gate.test.d.ts.map +0 -1
  54. package/dist/__tests__/integration/epic44-coverage-gate.test.js +0 -58
  55. package/dist/__tests__/integration/epic44-coverage-gate.test.js.map +0 -1
  56. package/dist/__tests__/integration/epic45-coverage-gate.test.d.ts +0 -11
  57. package/dist/__tests__/integration/epic45-coverage-gate.test.d.ts.map +0 -1
  58. package/dist/__tests__/integration/epic45-coverage-gate.test.js +0 -64
  59. package/dist/__tests__/integration/epic45-coverage-gate.test.js.map +0 -1
  60. package/dist/__tests__/integration/epic46-scenario-primary-executor.test.d.ts +0 -2
  61. package/dist/__tests__/integration/epic46-scenario-primary-executor.test.d.ts.map +0 -1
  62. package/dist/__tests__/integration/epic46-scenario-primary-executor.test.js +0 -285
  63. package/dist/__tests__/integration/epic46-scenario-primary-executor.test.js.map +0 -1
  64. package/dist/__tests__/integration/events.test.d.ts +0 -8
  65. package/dist/__tests__/integration/events.test.d.ts.map +0 -1
  66. package/dist/__tests__/integration/events.test.js +0 -194
  67. package/dist/__tests__/integration/events.test.js.map +0 -1
  68. package/dist/__tests__/integration/graphs.d.ts +0 -59
  69. package/dist/__tests__/integration/graphs.d.ts.map +0 -1
  70. package/dist/__tests__/integration/graphs.js +0 -164
  71. package/dist/__tests__/integration/graphs.js.map +0 -1
  72. package/dist/__tests__/integration/helpers.d.ts +0 -127
  73. package/dist/__tests__/integration/helpers.d.ts.map +0 -1
  74. package/dist/__tests__/integration/helpers.js +0 -167
  75. package/dist/__tests__/integration/helpers.js.map +0 -1
  76. package/dist/__tests__/integration/integrity.test.d.ts +0 -8
  77. package/dist/__tests__/integration/integrity.test.d.ts.map +0 -1
  78. package/dist/__tests__/integration/integrity.test.js +0 -198
  79. package/dist/__tests__/integration/integrity.test.js.map +0 -1
  80. package/dist/__tests__/integration/llm-edge-routing.test.d.ts +0 -21
  81. package/dist/__tests__/integration/llm-edge-routing.test.d.ts.map +0 -1
  82. package/dist/__tests__/integration/llm-edge-routing.test.js +0 -341
  83. package/dist/__tests__/integration/llm-edge-routing.test.js.map +0 -1
  84. package/dist/__tests__/integration/manager-loop.test.d.ts +0 -24
  85. package/dist/__tests__/integration/manager-loop.test.d.ts.map +0 -1
  86. package/dist/__tests__/integration/manager-loop.test.js +0 -276
  87. package/dist/__tests__/integration/manager-loop.test.js.map +0 -1
  88. package/dist/__tests__/integration/multi-type-graph.test.d.ts +0 -10
  89. package/dist/__tests__/integration/multi-type-graph.test.d.ts.map +0 -1
  90. package/dist/__tests__/integration/multi-type-graph.test.js +0 -100
  91. package/dist/__tests__/integration/multi-type-graph.test.js.map +0 -1
  92. package/dist/__tests__/integration/parallel-fan-out-fan-in.test.d.ts +0 -22
  93. package/dist/__tests__/integration/parallel-fan-out-fan-in.test.d.ts.map +0 -1
  94. package/dist/__tests__/integration/parallel-fan-out-fan-in.test.js +0 -515
  95. package/dist/__tests__/integration/parallel-fan-out-fan-in.test.js.map +0 -1
  96. package/dist/__tests__/integration/persistence.test.d.ts +0 -8
  97. package/dist/__tests__/integration/persistence.test.d.ts.map +0 -1
  98. package/dist/__tests__/integration/persistence.test.js +0 -129
  99. package/dist/__tests__/integration/persistence.test.js.map +0 -1
  100. package/dist/__tests__/integration/pipeline-templates-integration.test.d.ts +0 -16
  101. package/dist/__tests__/integration/pipeline-templates-integration.test.d.ts.map +0 -1
  102. package/dist/__tests__/integration/pipeline-templates-integration.test.js +0 -171
  103. package/dist/__tests__/integration/pipeline-templates-integration.test.js.map +0 -1
  104. package/dist/__tests__/integration/scenario-pipeline.test.d.ts +0 -11
  105. package/dist/__tests__/integration/scenario-pipeline.test.d.ts.map +0 -1
  106. package/dist/__tests__/integration/scenario-pipeline.test.js +0 -243
  107. package/dist/__tests__/integration/scenario-pipeline.test.js.map +0 -1
  108. package/dist/__tests__/integration/stylesheet-application.test.d.ts +0 -12
  109. package/dist/__tests__/integration/stylesheet-application.test.d.ts.map +0 -1
  110. package/dist/__tests__/integration/stylesheet-application.test.js +0 -119
  111. package/dist/__tests__/integration/stylesheet-application.test.js.map +0 -1
  112. package/dist/__tests__/integration/subgraph-execution.test.d.ts +0 -24
  113. package/dist/__tests__/integration/subgraph-execution.test.d.ts.map +0 -1
  114. package/dist/__tests__/integration/subgraph-execution.test.js +0 -291
  115. package/dist/__tests__/integration/subgraph-execution.test.js.map +0 -1
  116. package/dist/__tests__/integration/validation-errors.test.d.ts +0 -8
  117. package/dist/__tests__/integration/validation-errors.test.d.ts.map +0 -1
  118. package/dist/__tests__/integration/validation-errors.test.js +0 -150
  119. package/dist/__tests__/integration/validation-errors.test.js.map +0 -1
  120. package/dist/agent/__tests__/loop-detection.test.d.ts +0 -2
  121. package/dist/agent/__tests__/loop-detection.test.d.ts.map +0 -1
  122. package/dist/agent/__tests__/loop-detection.test.js +0 -236
  123. package/dist/agent/__tests__/loop-detection.test.js.map +0 -1
  124. package/dist/agent/__tests__/loop.test.d.ts +0 -2
  125. package/dist/agent/__tests__/loop.test.d.ts.map +0 -1
  126. package/dist/agent/__tests__/loop.test.js +0 -868
  127. package/dist/agent/__tests__/loop.test.js.map +0 -1
  128. package/dist/agent/__tests__/truncation.test.d.ts +0 -2
  129. package/dist/agent/__tests__/truncation.test.d.ts.map +0 -1
  130. package/dist/agent/__tests__/truncation.test.js +0 -276
  131. package/dist/agent/__tests__/truncation.test.js.map +0 -1
  132. package/dist/agent/tools/__tests__/anthropic-tools.test.d.ts +0 -6
  133. package/dist/agent/tools/__tests__/anthropic-tools.test.d.ts.map +0 -1
  134. package/dist/agent/tools/__tests__/anthropic-tools.test.js +0 -49
  135. package/dist/agent/tools/__tests__/anthropic-tools.test.js.map +0 -1
  136. package/dist/agent/tools/__tests__/environment.test.d.ts +0 -6
  137. package/dist/agent/tools/__tests__/environment.test.d.ts.map +0 -1
  138. package/dist/agent/tools/__tests__/environment.test.js +0 -33
  139. package/dist/agent/tools/__tests__/environment.test.js.map +0 -1
  140. package/dist/agent/tools/__tests__/gemini-tools.test.d.ts +0 -6
  141. package/dist/agent/tools/__tests__/gemini-tools.test.d.ts.map +0 -1
  142. package/dist/agent/tools/__tests__/gemini-tools.test.js +0 -98
  143. package/dist/agent/tools/__tests__/gemini-tools.test.js.map +0 -1
  144. package/dist/agent/tools/__tests__/openai-tools.test.d.ts +0 -6
  145. package/dist/agent/tools/__tests__/openai-tools.test.d.ts.map +0 -1
  146. package/dist/agent/tools/__tests__/openai-tools.test.js +0 -53
  147. package/dist/agent/tools/__tests__/openai-tools.test.js.map +0 -1
  148. package/dist/agent/tools/__tests__/patch.test.d.ts +0 -6
  149. package/dist/agent/tools/__tests__/patch.test.d.ts.map +0 -1
  150. package/dist/agent/tools/__tests__/patch.test.js +0 -116
  151. package/dist/agent/tools/__tests__/patch.test.js.map +0 -1
  152. package/dist/agent/tools/__tests__/profiles.test.d.ts +0 -6
  153. package/dist/agent/tools/__tests__/profiles.test.d.ts.map +0 -1
  154. package/dist/agent/tools/__tests__/profiles.test.js +0 -125
  155. package/dist/agent/tools/__tests__/profiles.test.js.map +0 -1
  156. package/dist/agent/tools/__tests__/registry.test.d.ts +0 -6
  157. package/dist/agent/tools/__tests__/registry.test.d.ts.map +0 -1
  158. package/dist/agent/tools/__tests__/registry.test.js +0 -94
  159. package/dist/agent/tools/__tests__/registry.test.js.map +0 -1
  160. package/dist/agent/tools/__tests__/shared.test.d.ts +0 -6
  161. package/dist/agent/tools/__tests__/shared.test.d.ts.map +0 -1
  162. package/dist/agent/tools/__tests__/shared.test.js +0 -131
  163. package/dist/agent/tools/__tests__/shared.test.js.map +0 -1
  164. package/dist/backend/__tests__/direct-backend.test.d.ts +0 -14
  165. package/dist/backend/__tests__/direct-backend.test.d.ts.map +0 -1
  166. package/dist/backend/__tests__/direct-backend.test.js +0 -393
  167. package/dist/backend/__tests__/direct-backend.test.js.map +0 -1
  168. package/dist/backend/__tests__/direct-bootstrap.test.d.ts +0 -7
  169. package/dist/backend/__tests__/direct-bootstrap.test.d.ts.map +0 -1
  170. package/dist/backend/__tests__/direct-bootstrap.test.js +0 -177
  171. package/dist/backend/__tests__/direct-bootstrap.test.js.map +0 -1
  172. package/dist/backend/__tests__/mock-backend.test.d.ts +0 -7
  173. package/dist/backend/__tests__/mock-backend.test.d.ts.map +0 -1
  174. package/dist/backend/__tests__/mock-backend.test.js +0 -273
  175. package/dist/backend/__tests__/mock-backend.test.js.map +0 -1
  176. package/dist/backend/__tests__/parity.test.d.ts +0 -17
  177. package/dist/backend/__tests__/parity.test.d.ts.map +0 -1
  178. package/dist/backend/__tests__/parity.test.js +0 -411
  179. package/dist/backend/__tests__/parity.test.js.map +0 -1
  180. package/dist/context/__tests__/auto-summarizer.test.d.ts +0 -14
  181. package/dist/context/__tests__/auto-summarizer.test.d.ts.map +0 -1
  182. package/dist/context/__tests__/auto-summarizer.test.js +0 -189
  183. package/dist/context/__tests__/auto-summarizer.test.js.map +0 -1
  184. package/dist/context/__tests__/context-cli-command.test.d.ts +0 -7
  185. package/dist/context/__tests__/context-cli-command.test.d.ts.map +0 -1
  186. package/dist/context/__tests__/context-cli-command.test.js +0 -331
  187. package/dist/context/__tests__/context-cli-command.test.js.map +0 -1
  188. package/dist/context/__tests__/pyramid-summary-integration.test.d.ts +0 -2
  189. package/dist/context/__tests__/pyramid-summary-integration.test.d.ts.map +0 -1
  190. package/dist/context/__tests__/pyramid-summary-integration.test.js +0 -533
  191. package/dist/context/__tests__/pyramid-summary-integration.test.js.map +0 -1
  192. package/dist/context/__tests__/summarizer.test.d.ts +0 -2
  193. package/dist/context/__tests__/summarizer.test.d.ts.map +0 -1
  194. package/dist/context/__tests__/summarizer.test.js +0 -189
  195. package/dist/context/__tests__/summarizer.test.js.map +0 -1
  196. package/dist/context/__tests__/summary-cache.test.d.ts +0 -2
  197. package/dist/context/__tests__/summary-cache.test.d.ts.map +0 -1
  198. package/dist/context/__tests__/summary-cache.test.js +0 -214
  199. package/dist/context/__tests__/summary-cache.test.js.map +0 -1
  200. package/dist/context/__tests__/summary-metrics.test.d.ts +0 -2
  201. package/dist/context/__tests__/summary-metrics.test.d.ts.map +0 -1
  202. package/dist/context/__tests__/summary-metrics.test.js +0 -172
  203. package/dist/context/__tests__/summary-metrics.test.js.map +0 -1
  204. package/dist/context/__tests__/summary-types.test.d.ts +0 -2
  205. package/dist/context/__tests__/summary-types.test.d.ts.map +0 -1
  206. package/dist/context/__tests__/summary-types.test.js +0 -130
  207. package/dist/context/__tests__/summary-types.test.js.map +0 -1
  208. package/dist/convergence/__tests__/budget.test.d.ts +0 -6
  209. package/dist/convergence/__tests__/budget.test.d.ts.map +0 -1
  210. package/dist/convergence/__tests__/budget.test.js +0 -187
  211. package/dist/convergence/__tests__/budget.test.js.map +0 -1
  212. package/dist/convergence/__tests__/controller.test.d.ts +0 -9
  213. package/dist/convergence/__tests__/controller.test.d.ts.map +0 -1
  214. package/dist/convergence/__tests__/controller.test.js +0 -585
  215. package/dist/convergence/__tests__/controller.test.js.map +0 -1
  216. package/dist/convergence/__tests__/dual-signal.test.d.ts +0 -14
  217. package/dist/convergence/__tests__/dual-signal.test.d.ts.map +0 -1
  218. package/dist/convergence/__tests__/dual-signal.test.js +0 -123
  219. package/dist/convergence/__tests__/dual-signal.test.js.map +0 -1
  220. package/dist/convergence/__tests__/epic46-integration.test.d.ts +0 -15
  221. package/dist/convergence/__tests__/epic46-integration.test.d.ts.map +0 -1
  222. package/dist/convergence/__tests__/epic46-integration.test.js +0 -522
  223. package/dist/convergence/__tests__/epic46-integration.test.js.map +0 -1
  224. package/dist/convergence/__tests__/plateau.test.d.ts +0 -6
  225. package/dist/convergence/__tests__/plateau.test.d.ts.map +0 -1
  226. package/dist/convergence/__tests__/plateau.test.js +0 -163
  227. package/dist/convergence/__tests__/plateau.test.js.map +0 -1
  228. package/dist/convergence/__tests__/remediation.test.d.ts +0 -11
  229. package/dist/convergence/__tests__/remediation.test.d.ts.map +0 -1
  230. package/dist/convergence/__tests__/remediation.test.js +0 -209
  231. package/dist/convergence/__tests__/remediation.test.js.map +0 -1
  232. package/dist/convergence/__tests__/scenario-primary.test.d.ts +0 -13
  233. package/dist/convergence/__tests__/scenario-primary.test.d.ts.map +0 -1
  234. package/dist/convergence/__tests__/scenario-primary.test.js +0 -183
  235. package/dist/convergence/__tests__/scenario-primary.test.js.map +0 -1
  236. package/dist/factory-command.test.d.ts +0 -8
  237. package/dist/factory-command.test.d.ts.map +0 -1
  238. package/dist/factory-command.test.js +0 -304
  239. package/dist/factory-command.test.js.map +0 -1
  240. package/dist/graph/__tests__/attractor-compliance.test.d.ts +0 -10
  241. package/dist/graph/__tests__/attractor-compliance.test.d.ts.map +0 -1
  242. package/dist/graph/__tests__/attractor-compliance.test.js +0 -766
  243. package/dist/graph/__tests__/attractor-compliance.test.js.map +0 -1
  244. package/dist/graph/__tests__/checkpoint.test.d.ts +0 -8
  245. package/dist/graph/__tests__/checkpoint.test.d.ts.map +0 -1
  246. package/dist/graph/__tests__/checkpoint.test.js +0 -329
  247. package/dist/graph/__tests__/checkpoint.test.js.map +0 -1
  248. package/dist/graph/__tests__/condition-parser.test.d.ts +0 -14
  249. package/dist/graph/__tests__/condition-parser.test.d.ts.map +0 -1
  250. package/dist/graph/__tests__/condition-parser.test.js +0 -406
  251. package/dist/graph/__tests__/condition-parser.test.js.map +0 -1
  252. package/dist/graph/__tests__/context.test.d.ts +0 -14
  253. package/dist/graph/__tests__/context.test.d.ts.map +0 -1
  254. package/dist/graph/__tests__/context.test.js +0 -276
  255. package/dist/graph/__tests__/context.test.js.map +0 -1
  256. package/dist/graph/__tests__/edge-selector-events.test.d.ts +0 -11
  257. package/dist/graph/__tests__/edge-selector-events.test.d.ts.map +0 -1
  258. package/dist/graph/__tests__/edge-selector-events.test.js +0 -184
  259. package/dist/graph/__tests__/edge-selector-events.test.js.map +0 -1
  260. package/dist/graph/__tests__/edge-selector.test.d.ts +0 -6
  261. package/dist/graph/__tests__/edge-selector.test.d.ts.map +0 -1
  262. package/dist/graph/__tests__/edge-selector.test.js +0 -452
  263. package/dist/graph/__tests__/edge-selector.test.js.map +0 -1
  264. package/dist/graph/__tests__/executor-convergence.test.d.ts +0 -12
  265. package/dist/graph/__tests__/executor-convergence.test.d.ts.map +0 -1
  266. package/dist/graph/__tests__/executor-convergence.test.js +0 -432
  267. package/dist/graph/__tests__/executor-convergence.test.js.map +0 -1
  268. package/dist/graph/__tests__/executor-fidelity.test.d.ts +0 -13
  269. package/dist/graph/__tests__/executor-fidelity.test.d.ts.map +0 -1
  270. package/dist/graph/__tests__/executor-fidelity.test.js +0 -335
  271. package/dist/graph/__tests__/executor-fidelity.test.js.map +0 -1
  272. package/dist/graph/__tests__/executor.test.d.ts +0 -14
  273. package/dist/graph/__tests__/executor.test.d.ts.map +0 -1
  274. package/dist/graph/__tests__/executor.test.js +0 -901
  275. package/dist/graph/__tests__/executor.test.js.map +0 -1
  276. package/dist/graph/__tests__/fidelity.test.d.ts +0 -8
  277. package/dist/graph/__tests__/fidelity.test.d.ts.map +0 -1
  278. package/dist/graph/__tests__/fidelity.test.js +0 -135
  279. package/dist/graph/__tests__/fidelity.test.js.map +0 -1
  280. package/dist/graph/__tests__/llm-evaluator.test.d.ts +0 -7
  281. package/dist/graph/__tests__/llm-evaluator.test.d.ts.map +0 -1
  282. package/dist/graph/__tests__/llm-evaluator.test.js +0 -106
  283. package/dist/graph/__tests__/llm-evaluator.test.js.map +0 -1
  284. package/dist/graph/__tests__/parser-chaining.test.d.ts +0 -13
  285. package/dist/graph/__tests__/parser-chaining.test.d.ts.map +0 -1
  286. package/dist/graph/__tests__/parser-chaining.test.js +0 -215
  287. package/dist/graph/__tests__/parser-chaining.test.js.map +0 -1
  288. package/dist/graph/__tests__/parser.test.d.ts +0 -22
  289. package/dist/graph/__tests__/parser.test.d.ts.map +0 -1
  290. package/dist/graph/__tests__/parser.test.js +0 -452
  291. package/dist/graph/__tests__/parser.test.js.map +0 -1
  292. package/dist/graph/__tests__/run-state.test.d.ts +0 -13
  293. package/dist/graph/__tests__/run-state.test.d.ts.map +0 -1
  294. package/dist/graph/__tests__/run-state.test.js +0 -189
  295. package/dist/graph/__tests__/run-state.test.js.map +0 -1
  296. package/dist/graph/__tests__/transformer.test.d.ts +0 -16
  297. package/dist/graph/__tests__/transformer.test.d.ts.map +0 -1
  298. package/dist/graph/__tests__/transformer.test.js +0 -350
  299. package/dist/graph/__tests__/transformer.test.js.map +0 -1
  300. package/dist/graph/__tests__/validator-errors.test.d.ts +0 -15
  301. package/dist/graph/__tests__/validator-errors.test.d.ts.map +0 -1
  302. package/dist/graph/__tests__/validator-errors.test.js +0 -572
  303. package/dist/graph/__tests__/validator-errors.test.js.map +0 -1
  304. package/dist/graph/__tests__/validator-warnings.test.d.ts +0 -15
  305. package/dist/graph/__tests__/validator-warnings.test.d.ts.map +0 -1
  306. package/dist/graph/__tests__/validator-warnings.test.js +0 -363
  307. package/dist/graph/__tests__/validator-warnings.test.js.map +0 -1
  308. package/dist/handlers/__tests__/codergen-handler.test.d.ts +0 -14
  309. package/dist/handlers/__tests__/codergen-handler.test.d.ts.map +0 -1
  310. package/dist/handlers/__tests__/codergen-handler.test.js +0 -442
  311. package/dist/handlers/__tests__/codergen-handler.test.js.map +0 -1
  312. package/dist/handlers/__tests__/fan-in.test.d.ts +0 -14
  313. package/dist/handlers/__tests__/fan-in.test.d.ts.map +0 -1
  314. package/dist/handlers/__tests__/fan-in.test.js +0 -399
  315. package/dist/handlers/__tests__/fan-in.test.js.map +0 -1
  316. package/dist/handlers/__tests__/join-policy.test.d.ts +0 -9
  317. package/dist/handlers/__tests__/join-policy.test.d.ts.map +0 -1
  318. package/dist/handlers/__tests__/join-policy.test.js +0 -201
  319. package/dist/handlers/__tests__/join-policy.test.js.map +0 -1
  320. package/dist/handlers/__tests__/manager-loop.test.d.ts +0 -14
  321. package/dist/handlers/__tests__/manager-loop.test.d.ts.map +0 -1
  322. package/dist/handlers/__tests__/manager-loop.test.js +0 -322
  323. package/dist/handlers/__tests__/manager-loop.test.js.map +0 -1
  324. package/dist/handlers/__tests__/parallel-events.test.d.ts +0 -12
  325. package/dist/handlers/__tests__/parallel-events.test.d.ts.map +0 -1
  326. package/dist/handlers/__tests__/parallel-events.test.js +0 -252
  327. package/dist/handlers/__tests__/parallel-events.test.js.map +0 -1
  328. package/dist/handlers/__tests__/parallel-handler.test.d.ts +0 -14
  329. package/dist/handlers/__tests__/parallel-handler.test.d.ts.map +0 -1
  330. package/dist/handlers/__tests__/parallel-handler.test.js +0 -337
  331. package/dist/handlers/__tests__/parallel-handler.test.js.map +0 -1
  332. package/dist/handlers/__tests__/parallel-join.test.d.ts +0 -9
  333. package/dist/handlers/__tests__/parallel-join.test.d.ts.map +0 -1
  334. package/dist/handlers/__tests__/parallel-join.test.js +0 -267
  335. package/dist/handlers/__tests__/parallel-join.test.js.map +0 -1
  336. package/dist/handlers/__tests__/registry.test.d.ts +0 -14
  337. package/dist/handlers/__tests__/registry.test.d.ts.map +0 -1
  338. package/dist/handlers/__tests__/registry.test.js +0 -315
  339. package/dist/handlers/__tests__/registry.test.js.map +0 -1
  340. package/dist/handlers/__tests__/subgraph-events.test.d.ts +0 -10
  341. package/dist/handlers/__tests__/subgraph-events.test.d.ts.map +0 -1
  342. package/dist/handlers/__tests__/subgraph-events.test.js +0 -189
  343. package/dist/handlers/__tests__/subgraph-events.test.js.map +0 -1
  344. package/dist/handlers/__tests__/subgraph-inheritance.test.d.ts +0 -14
  345. package/dist/handlers/__tests__/subgraph-inheritance.test.d.ts.map +0 -1
  346. package/dist/handlers/__tests__/subgraph-inheritance.test.js +0 -267
  347. package/dist/handlers/__tests__/subgraph-inheritance.test.js.map +0 -1
  348. package/dist/handlers/__tests__/subgraph.test.d.ts +0 -14
  349. package/dist/handlers/__tests__/subgraph.test.d.ts.map +0 -1
  350. package/dist/handlers/__tests__/subgraph.test.js +0 -369
  351. package/dist/handlers/__tests__/subgraph.test.js.map +0 -1
  352. package/dist/handlers/__tests__/tool-handler.test.d.ts +0 -11
  353. package/dist/handlers/__tests__/tool-handler.test.d.ts.map +0 -1
  354. package/dist/handlers/__tests__/tool-handler.test.js +0 -184
  355. package/dist/handlers/__tests__/tool-handler.test.js.map +0 -1
  356. package/dist/handlers/__tests__/tool-scenario.test.d.ts +0 -12
  357. package/dist/handlers/__tests__/tool-scenario.test.d.ts.map +0 -1
  358. package/dist/handlers/__tests__/tool-scenario.test.js +0 -222
  359. package/dist/handlers/__tests__/tool-scenario.test.js.map +0 -1
  360. package/dist/handlers/__tests__/wait-human-handler.test.d.ts +0 -11
  361. package/dist/handlers/__tests__/wait-human-handler.test.d.ts.map +0 -1
  362. package/dist/handlers/__tests__/wait-human-handler.test.js +0 -251
  363. package/dist/handlers/__tests__/wait-human-handler.test.js.map +0 -1
  364. package/dist/llm/__tests__/client.test.d.ts +0 -2
  365. package/dist/llm/__tests__/client.test.d.ts.map +0 -1
  366. package/dist/llm/__tests__/client.test.js +0 -198
  367. package/dist/llm/__tests__/client.test.js.map +0 -1
  368. package/dist/llm/__tests__/types.test.d.ts +0 -2
  369. package/dist/llm/__tests__/types.test.d.ts.map +0 -1
  370. package/dist/llm/__tests__/types.test.js +0 -289
  371. package/dist/llm/__tests__/types.test.js.map +0 -1
  372. package/dist/llm/middleware/__tests__/cost-tracking.test.d.ts +0 -2
  373. package/dist/llm/middleware/__tests__/cost-tracking.test.d.ts.map +0 -1
  374. package/dist/llm/middleware/__tests__/cost-tracking.test.js +0 -73
  375. package/dist/llm/middleware/__tests__/cost-tracking.test.js.map +0 -1
  376. package/dist/llm/middleware/__tests__/logging.test.d.ts +0 -2
  377. package/dist/llm/middleware/__tests__/logging.test.d.ts.map +0 -1
  378. package/dist/llm/middleware/__tests__/logging.test.js +0 -127
  379. package/dist/llm/middleware/__tests__/logging.test.js.map +0 -1
  380. package/dist/llm/middleware/__tests__/retry.test.d.ts +0 -2
  381. package/dist/llm/middleware/__tests__/retry.test.d.ts.map +0 -1
  382. package/dist/llm/middleware/__tests__/retry.test.js +0 -126
  383. package/dist/llm/middleware/__tests__/retry.test.js.map +0 -1
  384. package/dist/llm/providers/__tests__/anthropic.test.d.ts +0 -2
  385. package/dist/llm/providers/__tests__/anthropic.test.d.ts.map +0 -1
  386. package/dist/llm/providers/__tests__/anthropic.test.js +0 -412
  387. package/dist/llm/providers/__tests__/anthropic.test.js.map +0 -1
  388. package/dist/llm/providers/__tests__/gemini.test.d.ts +0 -2
  389. package/dist/llm/providers/__tests__/gemini.test.d.ts.map +0 -1
  390. package/dist/llm/providers/__tests__/gemini.test.js +0 -591
  391. package/dist/llm/providers/__tests__/gemini.test.js.map +0 -1
  392. package/dist/llm/providers/__tests__/openai.test.d.ts +0 -2
  393. package/dist/llm/providers/__tests__/openai.test.d.ts.map +0 -1
  394. package/dist/llm/providers/__tests__/openai.test.js +0 -546
  395. package/dist/llm/providers/__tests__/openai.test.js.map +0 -1
  396. package/dist/persistence/__tests__/factory-queries.test.d.ts +0 -9
  397. package/dist/persistence/__tests__/factory-queries.test.d.ts.map +0 -1
  398. package/dist/persistence/__tests__/factory-queries.test.js +0 -372
  399. package/dist/persistence/__tests__/factory-queries.test.js.map +0 -1
  400. package/dist/persistence/__tests__/factory-schema.test.d.ts +0 -6
  401. package/dist/persistence/__tests__/factory-schema.test.d.ts.map +0 -1
  402. package/dist/persistence/__tests__/factory-schema.test.js +0 -105
  403. package/dist/persistence/__tests__/factory-schema.test.js.map +0 -1
  404. package/dist/scenarios/__tests__/cli-command-list.test.d.ts +0 -7
  405. package/dist/scenarios/__tests__/cli-command-list.test.d.ts.map +0 -1
  406. package/dist/scenarios/__tests__/cli-command-list.test.js +0 -237
  407. package/dist/scenarios/__tests__/cli-command-list.test.js.map +0 -1
  408. package/dist/scenarios/__tests__/cli-command.test.d.ts +0 -11
  409. package/dist/scenarios/__tests__/cli-command.test.d.ts.map +0 -1
  410. package/dist/scenarios/__tests__/cli-command.test.js +0 -275
  411. package/dist/scenarios/__tests__/cli-command.test.js.map +0 -1
  412. package/dist/scenarios/__tests__/integrity-pipeline.test.d.ts +0 -15
  413. package/dist/scenarios/__tests__/integrity-pipeline.test.d.ts.map +0 -1
  414. package/dist/scenarios/__tests__/integrity-pipeline.test.js +0 -318
  415. package/dist/scenarios/__tests__/integrity-pipeline.test.js.map +0 -1
  416. package/dist/scenarios/__tests__/runner-twins.test.d.ts +0 -13
  417. package/dist/scenarios/__tests__/runner-twins.test.d.ts.map +0 -1
  418. package/dist/scenarios/__tests__/runner-twins.test.js +0 -205
  419. package/dist/scenarios/__tests__/runner-twins.test.js.map +0 -1
  420. package/dist/scenarios/__tests__/scorer.test.d.ts +0 -11
  421. package/dist/scenarios/__tests__/scorer.test.d.ts.map +0 -1
  422. package/dist/scenarios/__tests__/scorer.test.js +0 -225
  423. package/dist/scenarios/__tests__/scorer.test.js.map +0 -1
  424. package/dist/scenarios/__tests__/scoring-integration.test.d.ts +0 -8
  425. package/dist/scenarios/__tests__/scoring-integration.test.d.ts.map +0 -1
  426. package/dist/scenarios/__tests__/scoring-integration.test.js +0 -178
  427. package/dist/scenarios/__tests__/scoring-integration.test.js.map +0 -1
  428. package/dist/scenarios/__tests__/store.test.d.ts +0 -5
  429. package/dist/scenarios/__tests__/store.test.d.ts.map +0 -1
  430. package/dist/scenarios/__tests__/store.test.js +0 -169
  431. package/dist/scenarios/__tests__/store.test.js.map +0 -1
  432. package/dist/stylesheet/__tests__/stylesheet.test.d.ts +0 -17
  433. package/dist/stylesheet/__tests__/stylesheet.test.d.ts.map +0 -1
  434. package/dist/stylesheet/__tests__/stylesheet.test.js +0 -368
  435. package/dist/stylesheet/__tests__/stylesheet.test.js.map +0 -1
  436. package/dist/templates/__tests__/templates.test.d.ts +0 -7
  437. package/dist/templates/__tests__/templates.test.d.ts.map +0 -1
  438. package/dist/templates/__tests__/templates.test.js +0 -92
  439. package/dist/templates/__tests__/templates.test.js.map +0 -1
  440. package/dist/twins/__tests__/docker-compose.test.d.ts +0 -13
  441. package/dist/twins/__tests__/docker-compose.test.d.ts.map +0 -1
  442. package/dist/twins/__tests__/docker-compose.test.js +0 -247
  443. package/dist/twins/__tests__/docker-compose.test.js.map +0 -1
  444. package/dist/twins/__tests__/health-monitor.test.d.ts +0 -19
  445. package/dist/twins/__tests__/health-monitor.test.d.ts.map +0 -1
  446. package/dist/twins/__tests__/health-monitor.test.js +0 -301
  447. package/dist/twins/__tests__/health-monitor.test.js.map +0 -1
  448. package/dist/twins/__tests__/integration/e2e.test.d.ts +0 -18
  449. package/dist/twins/__tests__/integration/e2e.test.d.ts.map +0 -1
  450. package/dist/twins/__tests__/integration/e2e.test.js +0 -146
  451. package/dist/twins/__tests__/integration/e2e.test.js.map +0 -1
  452. package/dist/twins/__tests__/integration/health-monitor-integration.test.d.ts +0 -16
  453. package/dist/twins/__tests__/integration/health-monitor-integration.test.d.ts.map +0 -1
  454. package/dist/twins/__tests__/integration/health-monitor-integration.test.js +0 -183
  455. package/dist/twins/__tests__/integration/health-monitor-integration.test.js.map +0 -1
  456. package/dist/twins/__tests__/integration/helpers.d.ts +0 -32
  457. package/dist/twins/__tests__/integration/helpers.d.ts.map +0 -1
  458. package/dist/twins/__tests__/integration/helpers.js +0 -67
  459. package/dist/twins/__tests__/integration/helpers.js.map +0 -1
  460. package/dist/twins/__tests__/integration/lifecycle.test.d.ts +0 -14
  461. package/dist/twins/__tests__/integration/lifecycle.test.d.ts.map +0 -1
  462. package/dist/twins/__tests__/integration/lifecycle.test.js +0 -127
  463. package/dist/twins/__tests__/integration/lifecycle.test.js.map +0 -1
  464. package/dist/twins/__tests__/integration/persistence-integration.test.d.ts +0 -14
  465. package/dist/twins/__tests__/integration/persistence-integration.test.d.ts.map +0 -1
  466. package/dist/twins/__tests__/integration/persistence-integration.test.js +0 -132
  467. package/dist/twins/__tests__/integration/persistence-integration.test.js.map +0 -1
  468. package/dist/twins/__tests__/persistence.test.d.ts +0 -10
  469. package/dist/twins/__tests__/persistence.test.d.ts.map +0 -1
  470. package/dist/twins/__tests__/persistence.test.js +0 -300
  471. package/dist/twins/__tests__/persistence.test.js.map +0 -1
  472. package/dist/twins/__tests__/registry.test.d.ts +0 -7
  473. package/dist/twins/__tests__/registry.test.d.ts.map +0 -1
  474. package/dist/twins/__tests__/registry.test.js +0 -282
  475. package/dist/twins/__tests__/registry.test.js.map +0 -1
  476. package/dist/twins/__tests__/run-state.test.d.ts +0 -9
  477. package/dist/twins/__tests__/run-state.test.d.ts.map +0 -1
  478. package/dist/twins/__tests__/run-state.test.js +0 -112
  479. package/dist/twins/__tests__/run-state.test.js.map +0 -1
  480. package/dist/twins/__tests__/templates-cli.test.d.ts +0 -10
  481. package/dist/twins/__tests__/templates-cli.test.d.ts.map +0 -1
  482. package/dist/twins/__tests__/templates-cli.test.js +0 -187
  483. package/dist/twins/__tests__/templates-cli.test.js.map +0 -1
  484. package/dist/twins/__tests__/templates.test.d.ts +0 -7
  485. package/dist/twins/__tests__/templates.test.d.ts.map +0 -1
  486. package/dist/twins/__tests__/templates.test.js +0 -87
  487. package/dist/twins/__tests__/templates.test.js.map +0 -1
  488. package/dist/twins/__tests__/twins-cli.test.d.ts +0 -11
  489. package/dist/twins/__tests__/twins-cli.test.d.ts.map +0 -1
  490. package/dist/twins/__tests__/twins-cli.test.js +0 -365
  491. package/dist/twins/__tests__/twins-cli.test.js.map +0 -1
@@ -1,449 +0,0 @@
1
- /**
2
- * Convergence loop cross-project validation integration tests.
3
- * Story 45-10: validates trycycle.dot fixture, two-iteration convergence via
4
- * conditional routing, pipeline budget cap, plateau detection, and remediation
5
- * context injection — all using real convergence implementations.
6
- *
7
- * AC2 — trycycle.dot fixture parses and validates without errors (5 nodes, correct attributes).
8
- * AC3 — two-iteration convergence: goal gate fails (score<0.8) then passes (score=1.0).
9
- * AC4 — pipeline budget cap halts the convergence loop.
10
- * AC5 — plateau detection halts the loop after constant scores fill the window.
11
- * AC6 — remediation context is injected before the retry dispatch at the exit goal gate.
12
- */
13
- // vi.mock is hoisted — must appear before imports that use the mocked module.
14
- // Use importOriginal to preserve exec/execFile/etc. used by @substrate-ai/core.
15
- vi.mock('child_process', async (importOriginal) => {
16
- const actual = await importOriginal();
17
- return {
18
- ...actual,
19
- spawn: vi.fn(),
20
- };
21
- });
22
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
23
- import { spawn } from 'child_process';
24
- import { parseGraph } from '../../graph/parser.js';
25
- import { createValidator } from '../../graph/validator.js';
26
- import { createGraphExecutor } from '../../graph/executor.js';
27
- import { getRemediationContext } from '../../convergence/remediation.js';
28
- import { HandlerRegistry } from '../../handlers/registry.js';
29
- import { startHandler } from '../../handlers/start.js';
30
- import { exitHandler } from '../../handlers/exit.js';
31
- import { conditionalHandler } from '../../handlers/conditional.js';
32
- import { createToolHandler } from '../../handlers/tool.js';
33
- import { makeTmpDir, cleanDir, buildScenarioRunResult, createMockSpawnProcess, readNamedFixtureDot, } from './helpers.js';
34
- // ---------------------------------------------------------------------------
35
- // Helpers
36
- // ---------------------------------------------------------------------------
37
- const mockSpawn = vi.mocked(spawn);
38
- /**
39
- * Build a registry for trycycle.dot tests.
40
- * - Real handlers for start, exit, conditional, tool (validate).
41
- * - Spy for codergen (shape=box → implement node).
42
- */
43
- function createTrycycleRegistry(implementSpy) {
44
- const registry = new HandlerRegistry();
45
- registry.register('start', startHandler);
46
- registry.register('exit', exitHandler);
47
- registry.register('conditional', conditionalHandler);
48
- registry.register('tool', createToolHandler());
49
- registry.register('codergen', implementSpy);
50
- registry.registerShape('Mdiamond', 'start');
51
- registry.registerShape('Msquare', 'exit');
52
- registry.registerShape('diamond', 'conditional');
53
- registry.registerShape('box', 'codergen');
54
- registry.registerShape('parallelogram', 'tool');
55
- registry.setDefault(implementSpy);
56
- return registry;
57
- }
58
- // ---------------------------------------------------------------------------
59
- // Mini-graph helpers for goal-gate-failure path tests (AC5, AC6)
60
- // ---------------------------------------------------------------------------
61
- const minimalNode = {
62
- id: '',
63
- label: '',
64
- shape: '',
65
- type: '',
66
- prompt: '',
67
- maxRetries: 0,
68
- goalGate: false,
69
- retryTarget: '',
70
- fallbackRetryTarget: '',
71
- fidelity: '',
72
- threadId: '',
73
- class: '',
74
- timeout: 0,
75
- llmModel: '',
76
- llmProvider: '',
77
- reasoningEffort: '',
78
- autoStatus: false,
79
- allowPartial: false,
80
- toolCommand: '',
81
- backend: '',
82
- };
83
- function makeNode(id, overrides) {
84
- return { ...minimalNode, id, ...overrides };
85
- }
86
- function makeEdge(fromNode, toNode, overrides) {
87
- return {
88
- fromNode,
89
- toNode,
90
- label: '',
91
- condition: '',
92
- weight: 0,
93
- fidelity: '',
94
- threadId: '',
95
- loopRestart: false,
96
- ...overrides,
97
- };
98
- }
99
- function makeMiniGraph(nodeList, edgeList, startNodeId, exitNodeId, graphRetryTarget) {
100
- const nodeMap = new Map(nodeList.map((n) => [n.id, n]));
101
- return {
102
- id: 'mini-test',
103
- goal: '',
104
- label: '',
105
- modelStylesheet: '',
106
- defaultMaxRetries: 0,
107
- retryTarget: graphRetryTarget ?? '',
108
- fallbackRetryTarget: '',
109
- defaultFidelity: '',
110
- nodes: nodeMap,
111
- edges: edgeList,
112
- outgoingEdges: (nodeId) => edgeList.filter((e) => e.fromNode === nodeId),
113
- startNode: () => nodeMap.get(startNodeId),
114
- exitNode: () => nodeMap.get(exitNodeId),
115
- };
116
- }
117
- function makeRegistry(handlerMap) {
118
- return {
119
- register: vi.fn(),
120
- registerShape: vi.fn(),
121
- setDefault: vi.fn(),
122
- resolve: vi.fn().mockImplementation((node) => {
123
- const handler = handlerMap[node.id];
124
- if (!handler)
125
- throw new Error(`No handler for node "${node.id}"`);
126
- return handler;
127
- }),
128
- };
129
- }
130
- // ---------------------------------------------------------------------------
131
- // Setup / teardown for trycycle.dot-based tests
132
- // ---------------------------------------------------------------------------
133
- let logsRoot;
134
- beforeEach(async () => {
135
- logsRoot = await makeTmpDir();
136
- vi.clearAllMocks();
137
- });
138
- afterEach(async () => {
139
- await cleanDir(logsRoot);
140
- vi.clearAllMocks();
141
- });
142
- // ---------------------------------------------------------------------------
143
- // AC2: trycycle.dot fixture parses and validates
144
- // ---------------------------------------------------------------------------
145
- describe('AC2: trycycle.dot fixture parses and validates', () => {
146
- it('AC2a: trycycle.dot parses without errors and validates with zero error diagnostics', () => {
147
- const dotSource = readNamedFixtureDot('trycycle.dot');
148
- const graph = parseGraph(dotSource);
149
- const validator = createValidator();
150
- // Should not throw
151
- expect(() => validator.validateOrRaise(graph)).not.toThrow();
152
- const diagnostics = validator.validate(graph);
153
- const errors = diagnostics.filter((d) => d.severity === 'error');
154
- expect(errors).toHaveLength(0);
155
- });
156
- it('AC2a: trycycle.dot graph has exactly 5 nodes', () => {
157
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
158
- expect(graph.nodes.size).toBe(5);
159
- });
160
- it('AC2a: trycycle.dot implement node has goalGate=true', () => {
161
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
162
- const implementNode = graph.nodes.get('implement');
163
- expect(implementNode).toBeDefined();
164
- expect(implementNode.goalGate).toBe(true);
165
- });
166
- it('AC2b: trycycle.dot implement node has retryTarget=implement', () => {
167
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
168
- const implementNode = graph.nodes.get('implement');
169
- expect(implementNode).toBeDefined();
170
- expect(implementNode.retryTarget).toBe('implement');
171
- });
172
- it('AC2a: trycycle.dot graph-level retryTarget attribute is "implement"', () => {
173
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
174
- expect(graph.retryTarget).toBe('implement');
175
- });
176
- });
177
- // ---------------------------------------------------------------------------
178
- // AC3: Two-iteration convergence via conditional routing
179
- // ---------------------------------------------------------------------------
180
- describe('AC3: two-iteration convergence via conditional routing', () => {
181
- it('AC3a: executor returns SUCCESS after two iterations (score 0.667 then 1.0)', async () => {
182
- const result1 = buildScenarioRunResult(2, 3);
183
- const result2 = buildScenarioRunResult(3, 3);
184
- mockSpawn
185
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result1), exitCode: 0 }))
186
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result2), exitCode: 0 }));
187
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
188
- const implementSpy = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
189
- const registry = createTrycycleRegistry(implementSpy);
190
- const result = await createGraphExecutor().run(graph, {
191
- runId: 'test-ac3a',
192
- logsRoot,
193
- handlerRegistry: registry,
194
- plateauWindow: 3,
195
- plateauThreshold: 0.05,
196
- });
197
- expect(result.status).toBe('SUCCESS');
198
- });
199
- it('AC3b: validate (tool) handler invoked exactly twice across both iterations', async () => {
200
- const result1 = buildScenarioRunResult(2, 3);
201
- const result2 = buildScenarioRunResult(3, 3);
202
- mockSpawn
203
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result1), exitCode: 0 }))
204
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result2), exitCode: 0 }));
205
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
206
- const implementSpy = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
207
- const registry = createTrycycleRegistry(implementSpy);
208
- await createGraphExecutor().run(graph, {
209
- runId: 'test-ac3b',
210
- logsRoot,
211
- handlerRegistry: registry,
212
- plateauWindow: 3,
213
- plateauThreshold: 0.05,
214
- });
215
- // spawn is called once per validate invocation
216
- expect(mockSpawn).toHaveBeenCalledTimes(2);
217
- });
218
- it('AC3c: implement (goal_gate) handler dispatched exactly twice', async () => {
219
- const result1 = buildScenarioRunResult(2, 3);
220
- const result2 = buildScenarioRunResult(3, 3);
221
- mockSpawn
222
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result1), exitCode: 0 }))
223
- .mockImplementationOnce(() => createMockSpawnProcess({ stdout: JSON.stringify(result2), exitCode: 0 }));
224
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
225
- const implementSpy = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
226
- const registry = createTrycycleRegistry(implementSpy);
227
- await createGraphExecutor().run(graph, {
228
- runId: 'test-ac3c',
229
- logsRoot,
230
- handlerRegistry: registry,
231
- plateauWindow: 3,
232
- plateauThreshold: 0.05,
233
- });
234
- // implement is dispatched once initially and once as retry target (via conditional routing)
235
- expect(implementSpy).toHaveBeenCalledTimes(2);
236
- });
237
- });
238
- // ---------------------------------------------------------------------------
239
- // AC4: Pipeline budget cap halts convergence loop
240
- // ---------------------------------------------------------------------------
241
- describe('AC4: pipeline budget cap halts convergence loop', () => {
242
- it('AC4a: budget cap halts when accumulated cost exceeds pipelineBudgetCapUsd', async () => {
243
- // validate always returns score=0 so conditional routes back to implement
244
- const result0 = buildScenarioRunResult(0, 3);
245
- mockSpawn.mockImplementation(() => createMockSpawnProcess({ stdout: JSON.stringify(result0), exitCode: 0 }));
246
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
247
- // implement returns SUCCESS with $0.04 per-dispatch cost
248
- const implementSpy = vi.fn().mockResolvedValue({
249
- status: 'SUCCESS',
250
- contextUpdates: { 'factory.lastNodeCostUsd': '0.04' },
251
- });
252
- const registry = createTrycycleRegistry(implementSpy);
253
- const result = await createGraphExecutor().run(graph, {
254
- runId: 'test-ac4a',
255
- logsRoot,
256
- handlerRegistry: registry,
257
- pipelineBudgetCapUsd: 0.05,
258
- });
259
- expect(result.status).toBe('FAIL');
260
- expect(result.failureReason).toContain('Pipeline budget exceeded');
261
- });
262
- it('AC4b: implement handler called at most twice before budget halts', async () => {
263
- const result0 = buildScenarioRunResult(0, 3);
264
- mockSpawn.mockImplementation(() => createMockSpawnProcess({ stdout: JSON.stringify(result0), exitCode: 0 }));
265
- const graph = parseGraph(readNamedFixtureDot('trycycle.dot'));
266
- const implementSpy = vi.fn().mockResolvedValue({
267
- status: 'SUCCESS',
268
- contextUpdates: { 'factory.lastNodeCostUsd': '0.04' },
269
- });
270
- const registry = createTrycycleRegistry(implementSpy);
271
- await createGraphExecutor().run(graph, {
272
- runId: 'test-ac4b',
273
- logsRoot,
274
- handlerRegistry: registry,
275
- pipelineBudgetCapUsd: 0.05,
276
- });
277
- // Accumulated cost exceeds $0.05 after second implement dispatch ($0.08 > $0.05),
278
- // so budget check fires before the third dispatch. implement called ≤ 2 times.
279
- expect(implementSpy.mock.calls.length).toBeLessThanOrEqual(2);
280
- });
281
- });
282
- // ---------------------------------------------------------------------------
283
- // AC5: Plateau detection halts loop when scores stop improving
284
- //
285
- // These tests use a custom mini-graph with a separate node named 'goalGate'
286
- // (goalGate=true) that is never dispatched. Since goalGate is never visited,
287
- // the goal-gate check always fails, and the convergence retry path fires on
288
- // each iteration — the only path where plateau detection runs.
289
- // ---------------------------------------------------------------------------
290
- describe('AC5: plateau detection via goal-gate failure path (mini-graph)', () => {
291
- it('AC5a: executor returns FAIL with plateau message after window fills with identical scores', async () => {
292
- // Graph: start → exit directly; a separate 'goalGate' node has goalGate=true but is NOT in
293
- // the traversal path (never dispatched). retryTarget='implement' on graph.
294
- // At exit each iteration: goalGate is unsatisfied (never dispatched, outcome=undefined).
295
- // The executor routes to implement (retry target) → exit → ... repeat.
296
- // convergence.satisfactionScore defaults to 0.0 each iteration (never set).
297
- // plateauWindow=3, plateauThreshold=0.5 → plateau fires after 3 iterations with [0,0,0].
298
- //
299
- // Trace:
300
- // iter1: start→exit: goalGate unsatisfied → record 0.0 → [0.0], not full → retry=implement
301
- // iter2: implement→exit: goalGate unsatisfied → record 0.0 → [0.0, 0.0], not full → retry
302
- // iter3: implement→exit: goalGate unsatisfied → record 0.0 → [0.0, 0.0, 0.0], window full → FAIL plateau
303
- const goalGateNode = makeNode('goalGate', { goalGate: true });
304
- const startH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
305
- const implementH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
306
- const registry = makeRegistry({ start: startH, implement: implementH });
307
- const graph = makeMiniGraph([makeNode('start'), goalGateNode, makeNode('implement'), makeNode('exit')], [
308
- makeEdge('start', 'exit'),
309
- makeEdge('implement', 'exit'),
310
- ], 'start', 'exit', 'implement');
311
- const result = await createGraphExecutor().run(graph, {
312
- runId: 'test-ac5a',
313
- logsRoot,
314
- handlerRegistry: registry,
315
- plateauWindow: 3,
316
- plateauThreshold: 0.5,
317
- });
318
- expect(result.status).toBe('FAIL');
319
- expect(result.failureReason).toContain('Convergence plateau detected');
320
- });
321
- it('AC5b: plateau failure reason includes score history', async () => {
322
- const goalGateNode = makeNode('goalGate', { goalGate: true });
323
- const startH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
324
- const implementH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
325
- const registry = makeRegistry({ start: startH, implement: implementH });
326
- const graph = makeMiniGraph([makeNode('start'), goalGateNode, makeNode('implement'), makeNode('exit')], [
327
- makeEdge('start', 'exit'),
328
- makeEdge('implement', 'exit'),
329
- ], 'start', 'exit', 'implement');
330
- const result = await createGraphExecutor().run(graph, {
331
- runId: 'test-ac5b',
332
- logsRoot,
333
- handlerRegistry: registry,
334
- plateauWindow: 3,
335
- plateauThreshold: 0.5,
336
- });
337
- // failure message format: "scores plateaued at [X, Y, Z]"
338
- // convergence.satisfactionScore defaults to 0.0 → scores are [0, 0, 0]
339
- expect(result.failureReason).toContain('iteration(s)');
340
- // The failure reason includes the bracketed score array
341
- expect(result.failureReason).toMatch(/\[.*\]/);
342
- });
343
- it('AC5c: plateau does NOT fire before window is filled (window=4, only 3 iterations)', async () => {
344
- // plateauWindow=4 → need 4 iterations to fill window. We stop after 3 via budget cap.
345
- // implement costs $0.04 per call; cap=$0.09 → budget exceeded after 3rd dispatch
346
- // (accumulated: $0.04 after iter1, $0.08 after iter2, $0.12 > $0.09 check fires after iter3 cost)
347
- // Wait: budget check is BEFORE dispatch. accumulated=$0.08 > $0.09? NO. dispatch iter3 cost=$0.04.
348
- // accumulated=$0.12. Budget check BEFORE iter4 dispatch: $0.12 > $0.09? YES → FAIL 'budget exceeded'.
349
- // So 3 goal-gate failures occur, window=[0.0,0.0,0.0] (3 entries < window=4), no plateau.
350
- const goalGateNode = makeNode('goalGate', { goalGate: true });
351
- const startH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
352
- const implementH = vi.fn().mockResolvedValue({
353
- status: 'SUCCESS',
354
- contextUpdates: { 'factory.lastNodeCostUsd': '0.04' },
355
- });
356
- const registry = makeRegistry({ start: startH, implement: implementH });
357
- const graph = makeMiniGraph([makeNode('start'), goalGateNode, makeNode('implement'), makeNode('exit')], [
358
- makeEdge('start', 'exit'),
359
- makeEdge('implement', 'exit'),
360
- ], 'start', 'exit', 'implement');
361
- const result = await createGraphExecutor().run(graph, {
362
- runId: 'test-ac5c',
363
- logsRoot,
364
- handlerRegistry: registry,
365
- plateauWindow: 4,
366
- plateauThreshold: 0.5,
367
- pipelineBudgetCapUsd: 0.09,
368
- });
369
- // Should fail due to budget exceeded, NOT plateau
370
- expect(result.status).toBe('FAIL');
371
- expect(result.failureReason).not.toContain('plateau');
372
- expect(result.failureReason).not.toContain('Plateau');
373
- });
374
- });
375
- // ---------------------------------------------------------------------------
376
- // AC6: Remediation context injected before retry dispatch
377
- //
378
- // Uses a mini-graph where the goal-gate failure path fires at the exit node,
379
- // injects remediation context, then routes to 'implement' as the retry target.
380
- // The implement handler captures the context on its second invocation.
381
- // ---------------------------------------------------------------------------
382
- describe('AC6: remediation context injected on goal-gate retry dispatch', () => {
383
- it('AC6a: getRemediationContext returns non-null with iterationCount=1 on retry dispatch', async () => {
384
- // Graph: start → exit directly. implement[goalGate=true] is NOT in the start→exit path.
385
- // graph.retryTarget='implement'. implement → exit.
386
- //
387
- // Trace:
388
- // start → exit: goal gate check → implement unsatisfied (never dispatched) → iter=1
389
- // → inject remediation context → route to implement (first dispatch)
390
- // implement → exit: goal gate check → implement = SUCCESS → passes → return SUCCESS
391
- //
392
- // implement is dispatched ONCE (as the retry target after goal gate fails).
393
- // The remediation context is injected into the graph context BEFORE implement is dispatched.
394
- const implementGoalGate = makeNode('implement', { goalGate: true });
395
- let capturedContextOnRetry;
396
- const implementH = vi.fn().mockImplementation(async (_node, context) => {
397
- // Capture context on the first (and only) dispatch — this is the retry dispatch
398
- capturedContextOnRetry = context;
399
- return { status: 'SUCCESS' };
400
- });
401
- const startH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
402
- const registry = makeRegistry({ start: startH, implement: implementH });
403
- const graph = makeMiniGraph([makeNode('start'), implementGoalGate, makeNode('exit')], [
404
- makeEdge('start', 'exit'),
405
- makeEdge('implement', 'exit'),
406
- ], 'start', 'exit', 'implement');
407
- const result = await createGraphExecutor().run(graph, {
408
- runId: 'test-ac6a',
409
- logsRoot,
410
- handlerRegistry: registry,
411
- });
412
- // Graph converges to SUCCESS: start→exit (goal gate fails) → implement→exit (passes)
413
- expect(result.status).toBe('SUCCESS');
414
- // implement was dispatched exactly once (as retry target after goal gate failure)
415
- expect(implementH).toHaveBeenCalledTimes(1);
416
- // Remediation context was injected before the implement retry dispatch
417
- expect(capturedContextOnRetry).toBeDefined();
418
- const remediation = getRemediationContext(capturedContextOnRetry);
419
- expect(remediation).toBeDefined();
420
- expect(remediation.iterationCount).toBe(1);
421
- expect(remediation.previousFailureReason).toBeTruthy();
422
- expect(remediation.previousFailureReason.length).toBeGreaterThan(0);
423
- });
424
- it('AC6b: remediation previousFailureReason mentions the failing goal gate node id', async () => {
425
- const implementGoalGate = makeNode('implement', { goalGate: true });
426
- let capturedContextOnRetry;
427
- const implementH = vi.fn().mockImplementation(async (_node, context) => {
428
- capturedContextOnRetry = context;
429
- return { status: 'SUCCESS' };
430
- });
431
- const startH = vi.fn().mockResolvedValue({ status: 'SUCCESS' });
432
- const registry = makeRegistry({ start: startH, implement: implementH });
433
- const graph = makeMiniGraph([makeNode('start'), implementGoalGate, makeNode('exit')], [
434
- makeEdge('start', 'exit'),
435
- makeEdge('implement', 'exit'),
436
- ], 'start', 'exit', 'implement');
437
- await createGraphExecutor().run(graph, {
438
- runId: 'test-ac6b',
439
- logsRoot,
440
- handlerRegistry: registry,
441
- });
442
- expect(capturedContextOnRetry).toBeDefined();
443
- const remediation = getRemediationContext(capturedContextOnRetry);
444
- expect(remediation).toBeDefined();
445
- // The previousFailureReason should contain the failing goal gate node id ('implement')
446
- expect(remediation.previousFailureReason).toContain('implement');
447
- });
448
- });
449
- //# sourceMappingURL=convergence-validation.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convergence-validation.test.js","sourceRoot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QAEvE,MAAM,KAAK,GAAG,aAAa,CACzB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EACxD;YACE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;YACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;SAC9B,EACD,OAAO,EACP,MAAM,EACN,WAAW,CACZ,CAAA;QAED,MAAM,mBAAmB,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE;YACrC,KAAK,EAAE,WAAW;YAClB,QAAQ;YACR,eAAe,EAAE,QAAiB;SACnC,CAAC,CAAA;QAEF,MAAM,CAAC,sBAAsB,CAAC,CAAC,WAAW,EAAE,CAAA;QAC5C,MAAM,WAAW,GAAG,qBAAqB,CAAC,sBAAuB,CAAC,CAAA;QAClE,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAA;QACjC,uFAAuF;QACvF,MAAM,CAAC,WAAY,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACnE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Epic 44 coverage gate — smoke tests for all public API exports (Story 44-10 AC7).
3
- *
4
- * This file validates that all Epic 44 public API exports are present and functional.
5
- * It does NOT duplicate logic from unit tests — it verifies the public API contract only.
6
- *
7
- * Expected per-story test counts and running total:
8
- * // 44-1: ~10, 44-2: ~8, 44-3: ~6, 44-4: ~8, 44-5: ~13, 44-6: ~7, 44-7: ~8, 44-8: ~6,
9
- * // 44-9: ~16, 44-10: ~33 → Total ≥ 115 >> gate of 60
10
- */
11
- export {};
12
- //# sourceMappingURL=epic44-coverage-gate.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"epic44-coverage-gate.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/epic44-coverage-gate.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -1,58 +0,0 @@
1
- /**
2
- * Epic 44 coverage gate — smoke tests for all public API exports (Story 44-10 AC7).
3
- *
4
- * This file validates that all Epic 44 public API exports are present and functional.
5
- * It does NOT duplicate logic from unit tests — it verifies the public API contract only.
6
- *
7
- * Expected per-story test counts and running total:
8
- * // 44-1: ~10, 44-2: ~8, 44-3: ~6, 44-4: ~8, 44-5: ~13, 44-6: ~7, 44-7: ~8, 44-8: ~6,
9
- * // 44-9: ~16, 44-10: ~33 → Total ≥ 115 >> gate of 60
10
- */
11
- import { describe, it, expect } from 'vitest';
12
- // Import all Epic 44 public API exports.
13
- // factorySchema is not re-exported from the barrel, so import from its direct path.
14
- import { ScenarioStore, computeSatisfactionScore, FactoryConfigSchema, loadFactoryConfig, registerFactoryCommand, } from '@substrate-ai/factory';
15
- import { factorySchema } from '../../persistence/factory-schema.js';
16
- // ---------------------------------------------------------------------------
17
- // Epic 44 public API smoke tests
18
- // ---------------------------------------------------------------------------
19
- describe('Epic 44 public API gate (AC7)', () => {
20
- it('gate-1: ScenarioStore is exported and constructible (story 44-1)', () => {
21
- expect(typeof ScenarioStore).not.toBe('undefined');
22
- const store = new ScenarioStore();
23
- expect(store).toBeDefined();
24
- expect(typeof store.discover).toBe('function');
25
- expect(typeof store.verify).toBe('function');
26
- expect(typeof store.verifyIntegrity).toBe('function');
27
- });
28
- it('gate-2: computeSatisfactionScore is exported as a function (story 44-5)', () => {
29
- expect(typeof computeSatisfactionScore).toBe('function');
30
- });
31
- it('gate-3: computeSatisfactionScore computes correct score (story 44-5)', () => {
32
- const result = {
33
- scenarios: [],
34
- summary: { total: 3, passed: 2, failed: 1 },
35
- durationMs: 150,
36
- };
37
- const score = computeSatisfactionScore(result);
38
- expect(score.score).toBeCloseTo(2 / 3, 5);
39
- expect(score.passes).toBe(false);
40
- expect(score.threshold).toBe(0.8);
41
- });
42
- it('gate-4: factorySchema is exported as a function (story 44-6)', () => {
43
- expect(typeof factorySchema).toBe('function');
44
- });
45
- it('gate-5: FactoryConfigSchema.parse({}) returns defaults without throwing (story 44-9)', () => {
46
- const config = FactoryConfigSchema.parse({});
47
- expect(config).toBeDefined();
48
- expect(config.scenario_dir).toBe('.substrate/scenarios/');
49
- expect(config.satisfaction_threshold).toBe(0.8);
50
- });
51
- it('gate-6: loadFactoryConfig is exported as a function (story 44-9)', () => {
52
- expect(typeof loadFactoryConfig).toBe('function');
53
- });
54
- it('gate-7: registerFactoryCommand is exported as a function (story 44-8)', () => {
55
- expect(typeof registerFactoryCommand).toBe('function');
56
- });
57
- });
58
- //# sourceMappingURL=epic44-coverage-gate.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"epic44-coverage-gate.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/epic44-coverage-gate.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE7C,yCAAyC;AACzC,oFAAoF;AACpF,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAEnE,8EAA8E;AAC9E,iCAAiC;AACjC,8EAA8E;AAE9E,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,IAAI,aAAa,EAAE,CAAA;QACjC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;QAC3B,MAAM,CAAC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,OAAO,KAAK,CAAC,MAAM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C,uBAAuB,CAAC,CAAA;QACzD,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Epic 45 coverage gate — smoke tests for all public convergence API exports.
3
- * Story 45-10 AC7: validates that all Epic 45 convergence components are
4
- * importable and callable before the Epic 46 satisfaction scoring layer is added.
5
- *
6
- * Expected per-story assertion counts and running total:
7
- * // 45-1 through 45-4: ~35, 45-5: ~8, 45-6: ~8, 45-7: ~10, 45-8: ~14, 45-9: ~8,
8
- * // 45-10: ~25 → Total ≥ 108
9
- */
10
- export {};
11
- //# sourceMappingURL=epic45-coverage-gate.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"epic45-coverage-gate.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/epic45-coverage-gate.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -1,64 +0,0 @@
1
- /**
2
- * Epic 45 coverage gate — smoke tests for all public convergence API exports.
3
- * Story 45-10 AC7: validates that all Epic 45 convergence components are
4
- * importable and callable before the Epic 46 satisfaction scoring layer is added.
5
- *
6
- * Expected per-story assertion counts and running total:
7
- * // 45-1 through 45-4: ~35, 45-5: ~8, 45-6: ~8, 45-7: ~10, 45-8: ~14, 45-9: ~8,
8
- * // 45-10: ~25 → Total ≥ 108
9
- */
10
- import { describe, it, expect } from 'vitest';
11
- import { createConvergenceController } from '../../convergence/controller.js';
12
- import { SessionBudgetManager, PipelineBudgetManager } from '../../convergence/budget.js';
13
- import { createPlateauDetector } from '../../convergence/plateau.js';
14
- import { buildRemediationContext, getRemediationContext } from '../../convergence/remediation.js';
15
- import { GraphContext } from '../../graph/context.js';
16
- // ---------------------------------------------------------------------------
17
- // Epic 45 public API smoke tests
18
- // ---------------------------------------------------------------------------
19
- describe('Epic 45 convergence API gate (AC7)', () => {
20
- it('gate-1: createConvergenceController is exported and returns a controller (story 45-1)', () => {
21
- const controller = createConvergenceController();
22
- expect(controller).toBeDefined();
23
- expect(typeof controller.checkGoalGates).toBe('function');
24
- expect(typeof controller.resolveRetryTarget).toBe('function');
25
- expect(typeof controller.recordOutcome).toBe('function');
26
- });
27
- it('gate-2: SessionBudgetManager is exported and constructible (story 45-5)', () => {
28
- const manager = new SessionBudgetManager();
29
- expect(manager).toBeDefined();
30
- expect(typeof manager.checkBudget).toBe('function');
31
- expect(typeof manager.getElapsedMs).toBe('function');
32
- });
33
- it('gate-3: PipelineBudgetManager is exported and constructible (story 45-4)', () => {
34
- const manager = new PipelineBudgetManager();
35
- expect(manager).toBeDefined();
36
- expect(typeof manager.checkBudget).toBe('function');
37
- expect(typeof manager.addCost).toBe('function');
38
- expect(typeof manager.getTotalCost).toBe('function');
39
- });
40
- it('gate-4: createPlateauDetector is exported and returns a detector (story 45-6)', () => {
41
- const detector = createPlateauDetector();
42
- expect(detector).toBeDefined();
43
- expect(typeof detector.recordScore).toBe('function');
44
- expect(typeof detector.isPlateaued).toBe('function');
45
- expect(typeof detector.getScores).toBe('function');
46
- });
47
- it('gate-5: buildRemediationContext is exported and builds a valid context (story 45-7)', () => {
48
- const ctx = buildRemediationContext({
49
- previousFailureReason: 'test failure',
50
- iterationCount: 1,
51
- satisfactionScoreHistory: [0.5],
52
- });
53
- expect(ctx).toBeDefined();
54
- expect(ctx.previousFailureReason).toBe('test failure');
55
- expect(ctx.iterationCount).toBe(1);
56
- expect(ctx.satisfactionScoreHistory).toEqual([0.5]);
57
- });
58
- it('gate-6: getRemediationContext returns undefined when no context injected (story 45-7)', () => {
59
- const context = new GraphContext();
60
- const result = getRemediationContext(context);
61
- expect(result).toBeUndefined();
62
- });
63
- });
64
- //# sourceMappingURL=epic45-coverage-gate.test.js.map