@interf/compiler 0.5.1 → 0.6.3

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 (353) hide show
  1. package/README.md +160 -201
  2. package/builtin-workflows/interf/README.md +22 -10
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +8 -5
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
  6. package/builtin-workflows/interf/improve/SKILL.md +4 -4
  7. package/builtin-workflows/interf/use/query/SKILL.md +1 -1
  8. package/builtin-workflows/interf/workflow.json +19 -5
  9. package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +10 -3
  10. package/dist/bin.js +2 -28
  11. package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
  12. package/dist/{commands → cli/commands}/check-draft.js +13 -13
  13. package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
  14. package/dist/{commands → cli/commands}/compile-controller.js +39 -44
  15. package/dist/cli/commands/compile.d.ts +33 -0
  16. package/dist/{commands → cli/commands}/compile.js +107 -33
  17. package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
  18. package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
  19. package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +20 -2
  20. package/dist/cli/commands/create-workflow-wizard.js +288 -0
  21. package/dist/{commands → cli/commands}/create.d.ts +2 -2
  22. package/dist/cli/commands/create.js +166 -0
  23. package/dist/cli/commands/dataset-selection.d.ts +6 -0
  24. package/dist/cli/commands/dataset-selection.js +11 -0
  25. package/dist/{commands → cli/commands}/default.js +5 -5
  26. package/dist/{commands → cli/commands}/doctor.js +12 -13
  27. package/dist/{commands → cli/commands}/executor-flow.d.ts +2 -2
  28. package/dist/{commands → cli/commands}/executor-flow.js +17 -17
  29. package/dist/cli/commands/init.d.ts +11 -0
  30. package/dist/{commands → cli/commands}/init.js +202 -109
  31. package/dist/{commands → cli/commands}/list.js +9 -6
  32. package/dist/{commands → cli/commands}/reset.js +5 -5
  33. package/dist/{commands → cli/commands}/source-config-wizard.d.ts +10 -5
  34. package/dist/{commands → cli/commands}/source-config-wizard.js +202 -95
  35. package/dist/{commands → cli/commands}/status.js +20 -11
  36. package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
  37. package/dist/{commands → cli/commands}/test-flow.js +30 -26
  38. package/dist/cli/commands/test.d.ts +14 -0
  39. package/dist/{commands → cli/commands}/test.js +48 -40
  40. package/dist/{commands → cli/commands}/verify.js +4 -4
  41. package/dist/cli/index.d.ts +21 -0
  42. package/dist/cli/index.js +33 -0
  43. package/dist/index.d.ts +22 -11
  44. package/dist/index.js +15 -6
  45. package/dist/lib/agent-args.d.ts +1 -3
  46. package/dist/lib/agent-args.js +1 -42
  47. package/dist/lib/agent-constants.d.ts +1 -5
  48. package/dist/lib/agent-constants.js +1 -28
  49. package/dist/lib/agent-detection.d.ts +1 -7
  50. package/dist/lib/agent-detection.js +1 -65
  51. package/dist/lib/agent-execution.d.ts +1 -2
  52. package/dist/lib/agent-execution.js +1 -242
  53. package/dist/lib/agent-logs.d.ts +1 -2
  54. package/dist/lib/agent-logs.js +1 -17
  55. package/dist/lib/agent-preflight.d.ts +1 -7
  56. package/dist/lib/agent-preflight.js +1 -76
  57. package/dist/lib/agent-render.d.ts +1 -8
  58. package/dist/lib/agent-render.js +1 -218
  59. package/dist/lib/agent-shells.d.ts +1 -44
  60. package/dist/lib/agent-shells.js +1 -847
  61. package/dist/lib/agent-status.d.ts +1 -3
  62. package/dist/lib/agent-status.js +1 -58
  63. package/dist/lib/agent-types.d.ts +1 -30
  64. package/dist/lib/agent-types.js +1 -1
  65. package/dist/lib/agents.d.ts +1 -6
  66. package/dist/lib/agents.js +1 -5
  67. package/dist/lib/builtin-compiled-workflow.d.ts +1 -129
  68. package/dist/lib/builtin-compiled-workflow.js +1 -153
  69. package/dist/lib/compiled-compile.d.ts +1 -52
  70. package/dist/lib/compiled-compile.js +1 -274
  71. package/dist/lib/compiled-paths.d.ts +1 -39
  72. package/dist/lib/compiled-paths.js +3 -103
  73. package/dist/lib/compiled-raw.d.ts +1 -49
  74. package/dist/lib/compiled-raw.js +3 -102
  75. package/dist/lib/compiled-reset.d.ts +1 -1
  76. package/dist/lib/compiled-reset.js +3 -44
  77. package/dist/lib/compiled-schema.d.ts +1 -27
  78. package/dist/lib/compiled-schema.js +1 -110
  79. package/dist/lib/discovery.d.ts +1 -1
  80. package/dist/lib/discovery.js +2 -2
  81. package/dist/lib/execution-profile.d.ts +1 -17
  82. package/dist/lib/execution-profile.js +1 -84
  83. package/dist/lib/executors.d.ts +1 -32
  84. package/dist/lib/executors.js +1 -43
  85. package/dist/lib/interf-bootstrap.d.ts +1 -3
  86. package/dist/lib/interf-bootstrap.js +3 -18
  87. package/dist/lib/interf-detect.d.ts +1 -33
  88. package/dist/lib/interf-detect.js +3 -176
  89. package/dist/lib/interf-scaffold.d.ts +1 -2
  90. package/dist/lib/interf-scaffold.js +3 -121
  91. package/dist/lib/interf-workflow-package.d.ts +1 -20
  92. package/dist/lib/interf-workflow-package.js +1 -276
  93. package/dist/lib/interf.d.ts +1 -5
  94. package/dist/lib/interf.js +3 -4
  95. package/dist/lib/local-workflows.d.ts +1 -53
  96. package/dist/lib/local-workflows.js +1 -399
  97. package/dist/lib/package-root.d.ts +1 -0
  98. package/dist/lib/package-root.js +1 -0
  99. package/dist/lib/project-paths.d.ts +1 -11
  100. package/dist/lib/project-paths.js +3 -32
  101. package/dist/lib/runtime-acceptance.d.ts +1 -9
  102. package/dist/lib/runtime-acceptance.js +1 -257
  103. package/dist/lib/runtime-contracts.d.ts +1 -2
  104. package/dist/lib/runtime-contracts.js +1 -47
  105. package/dist/lib/runtime-inventory.d.ts +1 -7
  106. package/dist/lib/runtime-inventory.js +1 -29
  107. package/dist/lib/runtime-paths.d.ts +1 -7
  108. package/dist/lib/runtime-paths.js +1 -23
  109. package/dist/lib/runtime-prompt.d.ts +1 -2
  110. package/dist/lib/runtime-prompt.js +1 -46
  111. package/dist/lib/runtime-reconcile.d.ts +1 -2
  112. package/dist/lib/runtime-reconcile.js +1 -156
  113. package/dist/lib/runtime-runs.d.ts +1 -11
  114. package/dist/lib/runtime-runs.js +1 -250
  115. package/dist/lib/runtime-types.d.ts +1 -43
  116. package/dist/lib/runtime-types.js +1 -1
  117. package/dist/lib/runtime.d.ts +1 -6
  118. package/dist/lib/runtime.js +1 -5
  119. package/dist/lib/schema.d.ts +4 -1016
  120. package/dist/lib/schema.js +6 -539
  121. package/dist/lib/source-config.d.ts +1 -39
  122. package/dist/lib/source-config.js +3 -293
  123. package/dist/lib/state-artifacts.d.ts +1 -8
  124. package/dist/lib/state-artifacts.js +1 -13
  125. package/dist/lib/state-health.d.ts +1 -4
  126. package/dist/lib/state-health.js +1 -132
  127. package/dist/lib/state-io.d.ts +1 -10
  128. package/dist/lib/state-io.js +1 -76
  129. package/dist/lib/state-paths.d.ts +1 -4
  130. package/dist/lib/state-paths.js +1 -13
  131. package/dist/lib/state-view.d.ts +1 -4
  132. package/dist/lib/state-view.js +1 -103
  133. package/dist/lib/state.d.ts +1 -6
  134. package/dist/lib/state.js +1 -5
  135. package/dist/lib/test-execution.d.ts +1 -14
  136. package/dist/lib/test-execution.js +3 -525
  137. package/dist/lib/test-matrices.d.ts +1 -90
  138. package/dist/lib/test-matrices.js +3 -96
  139. package/dist/lib/test-paths.d.ts +1 -12
  140. package/dist/lib/test-paths.js +3 -59
  141. package/dist/lib/test-profile-presets.d.ts +1 -57
  142. package/dist/lib/test-profile-presets.js +3 -50
  143. package/dist/lib/test-sandbox.d.ts +1 -11
  144. package/dist/lib/test-sandbox.js +3 -105
  145. package/dist/lib/test-specs.d.ts +1 -7
  146. package/dist/lib/test-specs.js +3 -114
  147. package/dist/lib/test-targets.d.ts +1 -5
  148. package/dist/lib/test-targets.js +3 -38
  149. package/dist/lib/test-types.d.ts +1 -17
  150. package/dist/lib/test-types.js +3 -1
  151. package/dist/lib/test.d.ts +1 -4
  152. package/dist/lib/test.js +3 -3
  153. package/dist/lib/validate-compiled.d.ts +1 -27
  154. package/dist/lib/validate-compiled.js +1 -238
  155. package/dist/lib/validate-helpers.d.ts +1 -12
  156. package/dist/lib/validate-helpers.js +1 -41
  157. package/dist/lib/validate.d.ts +1 -19
  158. package/dist/lib/validate.js +1 -256
  159. package/dist/lib/workflow-authoring.d.ts +1 -0
  160. package/dist/lib/workflow-authoring.js +1 -0
  161. package/dist/lib/workflow-definitions.d.ts +1 -68
  162. package/dist/lib/workflow-definitions.js +1 -206
  163. package/dist/lib/workflow-edit-session.d.ts +1 -0
  164. package/dist/lib/workflow-edit-session.js +1 -0
  165. package/dist/lib/workflow-edit-utils.d.ts +1 -0
  166. package/dist/lib/workflow-edit-utils.js +1 -0
  167. package/dist/lib/workflow-helpers.d.ts +1 -38
  168. package/dist/lib/workflow-helpers.js +1 -167
  169. package/dist/lib/workflow-improvement.d.ts +1 -22
  170. package/dist/lib/workflow-improvement.js +1 -396
  171. package/dist/lib/workflow-primitives.d.ts +1 -2
  172. package/dist/lib/workflow-primitives.js +1 -5
  173. package/dist/lib/workflow-review-paths.d.ts +1 -10
  174. package/dist/lib/workflow-review-paths.js +1 -27
  175. package/dist/lib/workflow-stage-policy.d.ts +1 -0
  176. package/dist/lib/workflow-stage-policy.js +1 -0
  177. package/dist/lib/workflow-stage-runner.d.ts +1 -41
  178. package/dist/lib/workflow-stage-runner.js +1 -109
  179. package/dist/lib/workflows.d.ts +1 -15
  180. package/dist/lib/workflows.js +1 -31
  181. package/dist/packages/agents/index.d.ts +17 -0
  182. package/dist/packages/agents/index.js +15 -0
  183. package/dist/packages/agents/lib/agents.d.ts +6 -0
  184. package/dist/packages/agents/lib/agents.js +5 -0
  185. package/dist/packages/agents/lib/args.d.ts +4 -0
  186. package/dist/packages/agents/lib/args.js +52 -0
  187. package/dist/packages/agents/lib/constants.d.ts +5 -0
  188. package/dist/packages/agents/lib/constants.js +28 -0
  189. package/dist/packages/agents/lib/detection.d.ts +7 -0
  190. package/dist/packages/agents/lib/detection.js +65 -0
  191. package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
  192. package/dist/packages/agents/lib/execution-profile.js +84 -0
  193. package/dist/packages/agents/lib/execution.d.ts +2 -0
  194. package/dist/packages/agents/lib/execution.js +243 -0
  195. package/dist/packages/agents/lib/executors.d.ts +32 -0
  196. package/dist/packages/agents/lib/executors.js +45 -0
  197. package/dist/packages/agents/lib/logs.d.ts +2 -0
  198. package/dist/packages/agents/lib/logs.js +17 -0
  199. package/dist/packages/agents/lib/preflight.d.ts +7 -0
  200. package/dist/packages/agents/lib/preflight.js +77 -0
  201. package/dist/packages/agents/lib/render.d.ts +8 -0
  202. package/dist/packages/agents/lib/render.js +218 -0
  203. package/dist/packages/agents/lib/schema.d.ts +8 -0
  204. package/dist/packages/agents/lib/schema.js +7 -0
  205. package/dist/packages/agents/lib/shells.d.ts +69 -0
  206. package/dist/packages/agents/lib/shells.js +1021 -0
  207. package/dist/packages/agents/lib/status.d.ts +3 -0
  208. package/dist/packages/agents/lib/status.js +58 -0
  209. package/dist/packages/agents/lib/types.d.ts +30 -0
  210. package/dist/packages/agents/lib/types.js +1 -0
  211. package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
  212. package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
  213. package/dist/packages/compiler/compiled-compile.d.ts +48 -0
  214. package/dist/packages/compiler/compiled-compile.js +256 -0
  215. package/dist/packages/compiler/compiled-schema.d.ts +31 -0
  216. package/dist/packages/compiler/compiled-schema.js +141 -0
  217. package/dist/packages/compiler/index.d.ts +24 -0
  218. package/dist/packages/compiler/index.js +23 -0
  219. package/dist/packages/compiler/lib/schema.d.ts +684 -0
  220. package/dist/packages/compiler/lib/schema.js +361 -0
  221. package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
  222. package/dist/packages/compiler/runtime-acceptance.js +269 -0
  223. package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
  224. package/dist/packages/compiler/runtime-contracts.js +48 -0
  225. package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
  226. package/dist/packages/compiler/runtime-inventory.js +29 -0
  227. package/dist/packages/compiler/runtime-paths.d.ts +8 -0
  228. package/dist/packages/compiler/runtime-paths.js +26 -0
  229. package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
  230. package/dist/packages/compiler/runtime-prompt.js +48 -0
  231. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
  232. package/dist/packages/compiler/runtime-reconcile.js +193 -0
  233. package/dist/packages/compiler/runtime-runs.d.ts +11 -0
  234. package/dist/packages/compiler/runtime-runs.js +262 -0
  235. package/dist/packages/compiler/runtime-types.d.ts +43 -0
  236. package/dist/packages/compiler/runtime-types.js +1 -0
  237. package/dist/packages/compiler/runtime.d.ts +6 -0
  238. package/dist/packages/compiler/runtime.js +5 -0
  239. package/dist/packages/compiler/state-artifacts.d.ts +8 -0
  240. package/dist/packages/compiler/state-artifacts.js +13 -0
  241. package/dist/packages/compiler/state-health.d.ts +4 -0
  242. package/dist/packages/compiler/state-health.js +132 -0
  243. package/dist/packages/compiler/state-io.d.ts +10 -0
  244. package/dist/packages/compiler/state-io.js +76 -0
  245. package/dist/packages/compiler/state-paths.d.ts +4 -0
  246. package/dist/packages/compiler/state-paths.js +13 -0
  247. package/dist/packages/compiler/state-view.d.ts +4 -0
  248. package/dist/packages/compiler/state-view.js +103 -0
  249. package/dist/packages/compiler/state.d.ts +7 -0
  250. package/dist/packages/compiler/state.js +12 -0
  251. package/dist/packages/compiler/validate-compiled.d.ts +27 -0
  252. package/dist/packages/compiler/validate-compiled.js +241 -0
  253. package/dist/packages/compiler/validate-helpers.d.ts +12 -0
  254. package/dist/packages/compiler/validate-helpers.js +41 -0
  255. package/dist/packages/compiler/validate.d.ts +21 -0
  256. package/dist/packages/compiler/validate.js +249 -0
  257. package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
  258. package/dist/packages/compiler/workflow-primitives.js +5 -0
  259. package/dist/packages/compiler/workflows.d.ts +15 -0
  260. package/dist/packages/compiler/workflows.js +31 -0
  261. package/dist/packages/project-model/compiled-paths.d.ts +40 -0
  262. package/dist/packages/project-model/compiled-paths.js +106 -0
  263. package/dist/packages/project-model/compiled-raw.d.ts +49 -0
  264. package/dist/packages/project-model/compiled-raw.js +102 -0
  265. package/dist/packages/project-model/compiled-reset.d.ts +2 -0
  266. package/dist/packages/project-model/compiled-reset.js +72 -0
  267. package/dist/packages/project-model/index.d.ts +11 -0
  268. package/dist/packages/project-model/index.js +10 -0
  269. package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
  270. package/dist/packages/project-model/interf-bootstrap.js +18 -0
  271. package/dist/packages/project-model/interf-detect.d.ts +33 -0
  272. package/dist/packages/project-model/interf-detect.js +176 -0
  273. package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
  274. package/dist/packages/project-model/interf-scaffold.js +124 -0
  275. package/dist/packages/project-model/interf.d.ts +5 -0
  276. package/dist/packages/project-model/interf.js +4 -0
  277. package/dist/packages/project-model/lib/schema.d.ts +125 -0
  278. package/dist/packages/project-model/lib/schema.js +62 -0
  279. package/dist/packages/project-model/project-paths.d.ts +11 -0
  280. package/dist/packages/project-model/project-paths.js +32 -0
  281. package/dist/packages/project-model/source-config.d.ts +38 -0
  282. package/dist/packages/project-model/source-config.js +297 -0
  283. package/dist/packages/testing/index.d.ts +13 -0
  284. package/dist/packages/testing/index.js +10 -0
  285. package/dist/packages/testing/lib/schema.d.ts +261 -0
  286. package/dist/packages/testing/lib/schema.js +119 -0
  287. package/dist/packages/testing/test-execution.d.ts +14 -0
  288. package/dist/packages/testing/test-execution.js +525 -0
  289. package/dist/packages/testing/test-matrices.d.ts +90 -0
  290. package/dist/packages/testing/test-matrices.js +96 -0
  291. package/dist/packages/testing/test-paths.d.ts +12 -0
  292. package/dist/packages/testing/test-paths.js +59 -0
  293. package/dist/packages/testing/test-profile-presets.d.ts +57 -0
  294. package/dist/packages/testing/test-profile-presets.js +50 -0
  295. package/dist/packages/testing/test-sandbox.d.ts +11 -0
  296. package/dist/packages/testing/test-sandbox.js +105 -0
  297. package/dist/packages/testing/test-specs.d.ts +7 -0
  298. package/dist/packages/testing/test-specs.js +114 -0
  299. package/dist/packages/testing/test-targets.d.ts +5 -0
  300. package/dist/packages/testing/test-targets.js +38 -0
  301. package/dist/packages/testing/test-types.d.ts +16 -0
  302. package/dist/packages/testing/test-types.js +1 -0
  303. package/dist/packages/testing/test.d.ts +4 -0
  304. package/dist/packages/testing/test.js +3 -0
  305. package/dist/packages/workflow-authoring/index.d.ts +4 -0
  306. package/dist/packages/workflow-authoring/index.js +4 -0
  307. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
  308. package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
  309. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
  310. package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
  311. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
  312. package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
  313. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
  314. package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
  315. package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
  316. package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
  317. package/dist/packages/workflow-package/index.d.ts +9 -0
  318. package/dist/packages/workflow-package/index.js +9 -0
  319. package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
  320. package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
  321. package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
  322. package/dist/packages/workflow-package/lib/package-root.js +6 -0
  323. package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
  324. package/dist/packages/workflow-package/local-workflows.js +422 -0
  325. package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
  326. package/dist/packages/workflow-package/workflow-definitions.js +203 -0
  327. package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
  328. package/dist/packages/workflow-package/workflow-helpers.js +167 -0
  329. package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
  330. package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
  331. package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
  332. package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
  333. package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
  334. package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
  335. package/package.json +44 -21
  336. package/dist/commands/compile.d.ts +0 -15
  337. package/dist/commands/create-workflow-wizard.js +0 -125
  338. package/dist/commands/create.js +0 -162
  339. package/dist/commands/init.d.ts +0 -3
  340. package/dist/commands/test.d.ts +0 -9
  341. package/dist/lib/compiled-home.d.ts +0 -5
  342. package/dist/lib/compiled-home.js +0 -32
  343. package/dist/lib/config.js +0 -9
  344. package/dist/lib/obsidian.d.ts +0 -1
  345. package/dist/lib/obsidian.js +0 -15
  346. package/dist/lib/summarize-plan.d.ts +0 -17
  347. package/dist/lib/summarize-plan.js +0 -120
  348. /package/dist/{commands → cli/commands}/default.d.ts +0 -0
  349. /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
  350. /package/dist/{commands → cli/commands}/list.d.ts +0 -0
  351. /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
  352. /package/dist/{commands → cli/commands}/status.d.ts +0 -0
  353. /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
@@ -1,90 +1 @@
1
- import { z } from "zod";
2
- import type { WorkflowExecutionProfile } from "./executors.js";
3
- export declare const TestMatrixAgentSchema: z.ZodEnum<{
4
- "claude-code": "claude-code";
5
- codex: "codex";
6
- }>;
7
- export declare const TestMatrixProfileSchema: z.ZodPipe<z.ZodObject<{
8
- id: z.ZodString;
9
- preset: z.ZodOptional<z.ZodEnum<{
10
- "release-claude-high": "release-claude-high";
11
- "release-codex-high": "release-codex-high";
12
- "tier1-max-claude": "tier1-max-claude";
13
- "tier1-max-codex": "tier1-max-codex";
14
- }>>;
15
- agent: z.ZodOptional<z.ZodEnum<{
16
- "claude-code": "claude-code";
17
- codex: "codex";
18
- }>>;
19
- model: z.ZodOptional<z.ZodString>;
20
- profile: z.ZodOptional<z.ZodString>;
21
- effort: z.ZodOptional<z.ZodString>;
22
- timeout_ms: z.ZodOptional<z.ZodNumber>;
23
- }, z.core.$strip>, z.ZodTransform<{
24
- agent: "claude-code" | "codex";
25
- id: string;
26
- preset?: "release-claude-high" | "release-codex-high" | "tier1-max-claude" | "tier1-max-codex" | undefined;
27
- model?: string | undefined;
28
- profile?: string | undefined;
29
- effort?: string | undefined;
30
- timeout_ms?: number | undefined;
31
- }, {
32
- id: string;
33
- preset?: "release-claude-high" | "release-codex-high" | "tier1-max-claude" | "tier1-max-codex" | undefined;
34
- agent?: "claude-code" | "codex" | undefined;
35
- model?: string | undefined;
36
- profile?: string | undefined;
37
- effort?: string | undefined;
38
- timeout_ms?: number | undefined;
39
- }>>;
40
- export declare const TestMatrixRetryPolicySchema: z.ZodObject<{
41
- max_attempts_per_profile: z.ZodOptional<z.ZodNumber>;
42
- }, z.core.$strip>;
43
- export declare const TestMatrixDatasetSchema: z.ZodString;
44
- export declare const TestMatrixSchema: z.ZodObject<{
45
- id: z.ZodString;
46
- name: z.ZodString;
47
- source_path: z.ZodString;
48
- compile_profiles: z.ZodArray<z.ZodPipe<z.ZodObject<{
49
- id: z.ZodString;
50
- preset: z.ZodOptional<z.ZodEnum<{
51
- "release-claude-high": "release-claude-high";
52
- "release-codex-high": "release-codex-high";
53
- "tier1-max-claude": "tier1-max-claude";
54
- "tier1-max-codex": "tier1-max-codex";
55
- }>>;
56
- agent: z.ZodOptional<z.ZodEnum<{
57
- "claude-code": "claude-code";
58
- codex: "codex";
59
- }>>;
60
- model: z.ZodOptional<z.ZodString>;
61
- profile: z.ZodOptional<z.ZodString>;
62
- effort: z.ZodOptional<z.ZodString>;
63
- timeout_ms: z.ZodOptional<z.ZodNumber>;
64
- }, z.core.$strip>, z.ZodTransform<{
65
- agent: "claude-code" | "codex";
66
- id: string;
67
- preset?: "release-claude-high" | "release-codex-high" | "tier1-max-claude" | "tier1-max-codex" | undefined;
68
- model?: string | undefined;
69
- profile?: string | undefined;
70
- effort?: string | undefined;
71
- timeout_ms?: number | undefined;
72
- }, {
73
- id: string;
74
- preset?: "release-claude-high" | "release-codex-high" | "tier1-max-claude" | "tier1-max-codex" | undefined;
75
- agent?: "claude-code" | "codex" | undefined;
76
- model?: string | undefined;
77
- profile?: string | undefined;
78
- effort?: string | undefined;
79
- timeout_ms?: number | undefined;
80
- }>>>;
81
- retry_policy: z.ZodOptional<z.ZodObject<{
82
- max_attempts_per_profile: z.ZodOptional<z.ZodNumber>;
83
- }, z.core.$strip>>;
84
- datasets: z.ZodArray<z.ZodString>;
85
- }, z.core.$strip>;
86
- export type TestMatrixProfile = z.infer<typeof TestMatrixProfileSchema>;
87
- export type TestMatrixRetryPolicy = z.infer<typeof TestMatrixRetryPolicySchema>;
88
- export type TestMatrixDataset = z.infer<typeof TestMatrixDatasetSchema>;
89
- export type TestMatrix = z.infer<typeof TestMatrixSchema>;
90
- export declare function testMatrixProfileToExecutionProfile(profile: TestMatrixProfile): WorkflowExecutionProfile;
1
+ export * from "../packages/testing/test-matrices.js";
@@ -1,96 +1,3 @@
1
- import { z } from "zod";
2
- import { WorkflowIdPattern } from "./schema.js";
3
- import { TestProfilePresetIdSchema, resolveTestProfilePreset, } from "./test-profile-presets.js";
4
- export const TestMatrixAgentSchema = z.enum(["claude-code", "codex"]);
5
- const TestMatrixProfileInputSchema = z.object({
6
- id: z.string().regex(WorkflowIdPattern),
7
- preset: TestProfilePresetIdSchema.optional(),
8
- agent: TestMatrixAgentSchema.optional(),
9
- model: z.string().min(1).optional(),
10
- profile: z.string().min(1).optional(),
11
- effort: z.string().min(1).optional(),
12
- timeout_ms: z.number().int().positive().optional(),
13
- }).superRefine((value, ctx) => {
14
- if (!value.preset && !value.agent) {
15
- ctx.addIssue({
16
- code: z.ZodIssueCode.custom,
17
- path: ["agent"],
18
- message: "Test-matrix profiles need either `agent` or `preset`.",
19
- });
20
- }
21
- if (value.preset) {
22
- for (const field of ["agent", "model", "profile", "effort", "timeout_ms"]) {
23
- if (value[field] !== undefined) {
24
- ctx.addIssue({
25
- code: z.ZodIssueCode.custom,
26
- path: [field],
27
- message: `Test profile presets own \`${field}\`; remove the inline override or stop using \`preset\`.`,
28
- });
29
- }
30
- }
31
- }
32
- });
33
- export const TestMatrixProfileSchema = TestMatrixProfileInputSchema.transform((value) => {
34
- if (!value.preset) {
35
- return {
36
- ...value,
37
- agent: value.agent,
38
- };
39
- }
40
- const preset = resolveTestProfilePreset(value.preset);
41
- return {
42
- ...value,
43
- agent: preset.agent,
44
- model: preset.model,
45
- profile: preset.profile,
46
- effort: preset.effort,
47
- timeout_ms: preset.timeout_ms,
48
- };
49
- });
50
- export const TestMatrixRetryPolicySchema = z.object({
51
- max_attempts_per_profile: z.number().int().min(1).max(5).optional(),
52
- });
53
- export const TestMatrixDatasetSchema = z.string().regex(WorkflowIdPattern);
54
- export const TestMatrixSchema = z.object({
55
- id: z.string().regex(WorkflowIdPattern),
56
- name: z.string().min(1),
57
- source_path: z.string().min(1),
58
- compile_profiles: z.array(TestMatrixProfileSchema).min(1),
59
- retry_policy: TestMatrixRetryPolicySchema.optional(),
60
- datasets: z.array(TestMatrixDatasetSchema).min(1),
61
- }).superRefine((value, ctx) => {
62
- const duplicateProfileIds = findDuplicates(value.compile_profiles.map((profile) => profile.id));
63
- for (const id of duplicateProfileIds) {
64
- ctx.addIssue({
65
- code: z.ZodIssueCode.custom,
66
- path: ["compile_profiles"],
67
- message: `Duplicate compile profile id in test matrix: ${id}`,
68
- });
69
- }
70
- const duplicateCompiledIds = findDuplicates(value.datasets);
71
- for (const id of duplicateCompiledIds) {
72
- ctx.addIssue({
73
- code: z.ZodIssueCode.custom,
74
- path: ["datasets"],
75
- message: `Duplicate dataset id in test matrix: ${id}`,
76
- });
77
- }
78
- });
79
- function findDuplicates(values) {
80
- const seen = new Set();
81
- const duplicates = new Set();
82
- for (const value of values) {
83
- if (seen.has(value))
84
- duplicates.add(value);
85
- seen.add(value);
86
- }
87
- return Array.from(duplicates.values()).sort();
88
- }
89
- export function testMatrixProfileToExecutionProfile(profile) {
90
- return {
91
- model: profile.model ?? null,
92
- profile: profile.profile ?? null,
93
- effort: profile.effort ?? null,
94
- timeoutMs: profile.timeout_ms ?? null,
95
- };
96
- }
1
+ // Compatibility shim for historical `src/lib/test-matrices.ts` imports.
2
+ // Source of truth: `src/packages/testing/test-matrices.ts`.
3
+ export * from "../packages/testing/test-matrices.js";
@@ -1,12 +1 @@
1
- import type { TestTargetType } from "./test-types.js";
2
- export declare const TEST_SPEC_EXTENSIONS: Set<string>;
3
- export declare function testSpecRootPath(sourcePath: string): string;
4
- export declare function testSpecTypePath(sourcePath: string, type: TestTargetType): string;
5
- export declare function targetTestRunsPath(compiledPath: string, type: TestTargetType): string;
6
- export declare function targetTestRunGitignorePath(compiledPath: string, type: TestTargetType): string;
7
- export declare function targetTestSandboxesPath(compiledPath: string, type: TestTargetType): string;
8
- export declare function targetTestSandboxGitignorePath(compiledPath: string, type: TestTargetType): string;
9
- export declare function testSpecFilePath(sourcePath: string, type: TestTargetType, id: string): string;
10
- export declare function normalizeTestId(input: string): string;
11
- export declare function assertTestId(id: string): void;
12
- export declare function assertWritableTestSpecPath(filePath: string): void;
1
+ export * from "../packages/testing/test-paths.js";
@@ -1,59 +1,3 @@
1
- import { existsSync } from "node:fs";
2
- import { basename, dirname, join } from "node:path";
3
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "./compiled-paths.js";
4
- const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
5
- export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
6
- export function testSpecRootPath(sourcePath) {
7
- return join(sourcePath, "interf", "tests", "internal", "specs");
8
- }
9
- export function testSpecTypePath(sourcePath, type) {
10
- return join(testSpecRootPath(sourcePath), type);
11
- }
12
- function isDatasetTestsRootPath(artifactRootPath) {
13
- return basename(dirname(artifactRootPath)) === "tests";
14
- }
15
- export function targetTestRunsPath(compiledPath, type) {
16
- if (existsSync(compiledInterfConfigPath(compiledPath))) {
17
- return join(targetTestRunsRootForCompiled(compiledPath), type);
18
- }
19
- if (isDatasetTestsRootPath(compiledPath)) {
20
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "runs");
21
- }
22
- throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected a compiled dataset or interf/tests/<dataset> root.`);
23
- }
24
- export function targetTestRunGitignorePath(compiledPath, type) {
25
- return join(targetTestRunsPath(compiledPath, type), ".gitignore");
26
- }
27
- export function targetTestSandboxesPath(compiledPath, type) {
28
- if (existsSync(compiledInterfConfigPath(compiledPath))) {
29
- return join(targetTestSandboxesRootForCompiled(compiledPath), type);
30
- }
31
- if (isDatasetTestsRootPath(compiledPath)) {
32
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "sandboxes");
33
- }
34
- throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected a compiled dataset or interf/tests/<dataset> root.`);
35
- }
36
- export function targetTestSandboxGitignorePath(compiledPath, type) {
37
- return join(targetTestSandboxesPath(compiledPath, type), ".gitignore");
38
- }
39
- export function testSpecFilePath(sourcePath, type, id) {
40
- return join(testSpecTypePath(sourcePath, type), `${id}.json`);
41
- }
42
- export function normalizeTestId(input) {
43
- return input
44
- .toLowerCase()
45
- .trim()
46
- .replace(/[^a-z0-9]+/g, "-")
47
- .replace(/^-+|-+$/g, "")
48
- .slice(0, 80);
49
- }
50
- export function assertTestId(id) {
51
- if (!TEST_ID_PATTERN.test(id)) {
52
- throw new Error(`Invalid test id: ${id}`);
53
- }
54
- }
55
- export function assertWritableTestSpecPath(filePath) {
56
- if (existsSync(filePath)) {
57
- throw new Error(`Test spec already exists: ${filePath}`);
58
- }
59
- }
1
+ // Compatibility shim for historical `src/lib/test-paths.ts` imports.
2
+ // Source of truth: `src/packages/testing/test-paths.ts`.
3
+ export * from "../packages/testing/test-paths.js";
@@ -1,57 +1 @@
1
- import { z } from "zod";
2
- declare const TestProfilePresetValueSchema: z.ZodObject<{
3
- agent: z.ZodEnum<{
4
- "claude-code": "claude-code";
5
- codex: "codex";
6
- }>;
7
- model: z.ZodOptional<z.ZodString>;
8
- profile: z.ZodOptional<z.ZodString>;
9
- effort: z.ZodOptional<z.ZodString>;
10
- timeout_ms: z.ZodOptional<z.ZodNumber>;
11
- label: z.ZodString;
12
- }, z.core.$strip>;
13
- export declare const TestProfilePresetIds: readonly ["release-claude-high", "release-codex-high", "tier1-max-claude", "tier1-max-codex"];
14
- export declare const TestProfilePresetIdSchema: z.ZodEnum<{
15
- "release-claude-high": "release-claude-high";
16
- "release-codex-high": "release-codex-high";
17
- "tier1-max-claude": "tier1-max-claude";
18
- "tier1-max-codex": "tier1-max-codex";
19
- }>;
20
- export declare const TestProfilePresets: {
21
- readonly "release-claude-high": {
22
- agent: "claude-code" | "codex";
23
- label: string;
24
- model?: string | undefined;
25
- profile?: string | undefined;
26
- effort?: string | undefined;
27
- timeout_ms?: number | undefined;
28
- };
29
- readonly "release-codex-high": {
30
- agent: "claude-code" | "codex";
31
- label: string;
32
- model?: string | undefined;
33
- profile?: string | undefined;
34
- effort?: string | undefined;
35
- timeout_ms?: number | undefined;
36
- };
37
- readonly "tier1-max-claude": {
38
- agent: "claude-code" | "codex";
39
- label: string;
40
- model?: string | undefined;
41
- profile?: string | undefined;
42
- effort?: string | undefined;
43
- timeout_ms?: number | undefined;
44
- };
45
- readonly "tier1-max-codex": {
46
- agent: "claude-code" | "codex";
47
- label: string;
48
- model?: string | undefined;
49
- profile?: string | undefined;
50
- effort?: string | undefined;
51
- timeout_ms?: number | undefined;
52
- };
53
- };
54
- export type TestProfilePresetId = z.infer<typeof TestProfilePresetIdSchema>;
55
- export type TestProfilePresetValue = z.infer<typeof TestProfilePresetValueSchema>;
56
- export declare function resolveTestProfilePreset(id: TestProfilePresetId): TestProfilePresetValue;
57
- export {};
1
+ export * from "../packages/testing/test-profile-presets.js";
@@ -1,50 +1,3 @@
1
- import { z } from "zod";
2
- const TestProfilePresetAgentSchema = z.enum(["claude-code", "codex"]);
3
- const TestProfilePresetValueSchema = z.object({
4
- agent: TestProfilePresetAgentSchema,
5
- model: z.string().min(1).optional(),
6
- profile: z.string().min(1).optional(),
7
- effort: z.string().min(1).optional(),
8
- timeout_ms: z.number().int().positive().optional(),
9
- label: z.string().min(1),
10
- });
11
- export const TestProfilePresetIds = [
12
- "release-claude-high",
13
- "release-codex-high",
14
- "tier1-max-claude",
15
- "tier1-max-codex",
16
- ];
17
- export const TestProfilePresetIdSchema = z.enum(TestProfilePresetIds);
18
- export const TestProfilePresets = {
19
- "release-claude-high": TestProfilePresetValueSchema.parse({
20
- agent: "claude-code",
21
- model: "claude-sonnet-4-6",
22
- effort: "high",
23
- timeout_ms: 480000,
24
- label: "Claude Code (Claude Sonnet 4.6, high)",
25
- }),
26
- "release-codex-high": TestProfilePresetValueSchema.parse({
27
- agent: "codex",
28
- model: "gpt-5.4-mini",
29
- effort: "high",
30
- timeout_ms: 480000,
31
- label: "Codex (GPT-5.4 Mini, high)",
32
- }),
33
- "tier1-max-claude": TestProfilePresetValueSchema.parse({
34
- agent: "claude-code",
35
- model: "claude-opus-4-6[1m]",
36
- effort: "max",
37
- timeout_ms: 480000,
38
- label: "Claude Code (Claude Opus 4.6 1M, max)",
39
- }),
40
- "tier1-max-codex": TestProfilePresetValueSchema.parse({
41
- agent: "codex",
42
- model: "gpt-5.4",
43
- effort: "xhigh",
44
- timeout_ms: 480000,
45
- label: "Codex (GPT-5.4, xhigh)",
46
- }),
47
- };
48
- export function resolveTestProfilePreset(id) {
49
- return TestProfilePresets[id];
50
- }
1
+ // Compatibility shim for historical `src/lib/test-profile-presets.ts` imports.
2
+ // Source of truth: `src/packages/testing/test-profile-presets.ts`.
3
+ export * from "../packages/testing/test-profile-presets.js";
@@ -1,11 +1 @@
1
- import type { TestTargetCandidate } from "./test-types.js";
2
- export type TestSandboxRetentionMode = "on-failure" | "always";
3
- export interface TestSandbox {
4
- rootPath: string;
5
- rawPath: string;
6
- targetPath: string;
7
- compiledPath: string | null;
8
- preserve(destinationPath: string): string;
9
- cleanup(): void;
10
- }
11
- export declare function createTestSandbox(target: TestTargetCandidate): TestSandbox;
1
+ export * from "../packages/testing/test-sandbox.js";
@@ -1,105 +1,3 @@
1
- import { cpSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { dirname, join, relative, sep } from "node:path";
4
- import { refreshCompiledBootstrapGuidance } from "./interf-bootstrap.js";
5
- import { readInterfConfig, resolveCompiledRawPath } from "./interf.js";
6
- import { projectRawTestQueryShell } from "./agent-shells.js";
7
- import { compiledCompiledPathForDataset } from "./project-paths.js";
8
- import { saveCompiledInterfConfig } from "./source-config.js";
9
- import { refreshCompiledArtifacts } from "./state.js";
10
- import { projectRawSnapshot } from "./compiled-raw.js";
11
- import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, workflowImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "./compiled-paths.js";
12
- function toPortableRelativePath(fromPath, toPath) {
13
- return relative(fromPath, toPath).split(sep).join("/");
14
- }
15
- function sanitizeCompiledArtifacts(compiledPath) {
16
- for (const absolutePath of [
17
- testRootForCompiled(compiledPath),
18
- targetTestSandboxesRootForCompiled(compiledPath),
19
- stageExecutionShellsRoot(compiledPath),
20
- workflowImprovementLoopsRoot(compiledPath),
21
- compiledRuntimeLogsRoot(compiledPath),
22
- compiledQueryAcceptanceRoot(compiledPath),
23
- ]) {
24
- rmSync(absolutePath, { recursive: true, force: true });
25
- }
26
- }
27
- export function createTestSandbox(target) {
28
- let sandboxRoot = mkdtempSync(join(tmpdir(), "interf-test-sandbox-"));
29
- let preserved = false;
30
- const sandboxCompiledPath = () => (target.type === "compiled"
31
- ? compiledCompiledPathForDataset(sandboxRoot, target.name)
32
- : null);
33
- const sandboxRawPath = () => (target.type === "compiled"
34
- ? join(compiledCompiledPathForDataset(sandboxRoot, target.name), "raw")
35
- : join(sandboxRoot, "raw"));
36
- const sandboxTargetPath = () => (target.type === "compiled"
37
- ? compiledCompiledPathForDataset(sandboxRoot, target.name)
38
- : sandboxRoot);
39
- try {
40
- if (target.type === "compiled") {
41
- mkdirSync(dirname(sandboxTargetPath()), { recursive: true });
42
- cpSync(target.path, sandboxTargetPath(), { recursive: true });
43
- sanitizeCompiledArtifacts(sandboxTargetPath());
44
- const sandboxConfig = readInterfConfig(sandboxTargetPath());
45
- if (!sandboxConfig) {
46
- throw new Error(`Sandbox compiled is missing interf.json: ${sandboxTargetPath()}`);
47
- }
48
- if (!existsSync(resolveCompiledRawPath(sandboxTargetPath(), sandboxConfig))) {
49
- throw new Error(`Sandbox compiled is missing its local raw snapshot: ${sandboxTargetPath()}. Rebuild the compiled dataset before testing it.`);
50
- }
51
- saveCompiledInterfConfig(sandboxTargetPath(), {
52
- ...sandboxConfig,
53
- checks: [],
54
- source: {
55
- path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
56
- dataset_path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
57
- },
58
- });
59
- refreshCompiledBootstrapGuidance(sandboxTargetPath());
60
- refreshCompiledArtifacts(sandboxTargetPath(), { ensureViewSpec: true });
61
- }
62
- else {
63
- projectRawSnapshot({
64
- sourcePath: target.path,
65
- destinationPath: sandboxRawPath(),
66
- compiledPath: target.path,
67
- mode: "link-or-copy",
68
- prune: false,
69
- preserveTimestamps: false,
70
- });
71
- projectRawTestQueryShell(sandboxTargetPath());
72
- }
73
- }
74
- catch (error) {
75
- rmSync(sandboxRoot, { recursive: true, force: true });
76
- throw error;
77
- }
78
- return {
79
- get rootPath() {
80
- return sandboxRoot;
81
- },
82
- get rawPath() {
83
- return sandboxRawPath();
84
- },
85
- get targetPath() {
86
- return sandboxTargetPath();
87
- },
88
- get compiledPath() {
89
- return sandboxCompiledPath();
90
- },
91
- preserve(destinationPath) {
92
- mkdirSync(dirname(destinationPath), { recursive: true });
93
- rmSync(destinationPath, { recursive: true, force: true });
94
- renameSync(sandboxRoot, destinationPath);
95
- sandboxRoot = destinationPath;
96
- preserved = true;
97
- return sandboxRoot;
98
- },
99
- cleanup() {
100
- if (preserved)
101
- return;
102
- rmSync(sandboxRoot, { recursive: true, force: true });
103
- },
104
- };
105
- }
1
+ // Compatibility shim for historical `src/lib/test-sandbox.ts` imports.
2
+ // Source of truth: `src/packages/testing/test-sandbox.ts`.
3
+ export * from "../packages/testing/test-sandbox.js";
@@ -1,7 +1 @@
1
- import type { TestSpec, TestTargetType, LoadedTestSpec } from "./test-types.js";
2
- export declare function listTestSpecs(sourcePath: string, type: TestTargetType): LoadedTestSpec[];
3
- export declare function loadTestSpec(sourcePath: string, type: TestTargetType, id: string): LoadedTestSpec | null;
4
- export declare function loadTestSpecFromFile(filePath: string): LoadedTestSpec | null;
5
- export declare function writeTestSpec(sourcePath: string, spec: TestSpec & {
6
- id?: string;
7
- }): string;
1
+ export * from "../packages/testing/test-specs.js";
@@ -1,114 +1,3 @@
1
- import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
2
- import { basename, extname, join } from "node:path";
3
- import { readJsonFileWithSchema } from "./parse.js";
4
- import { TestSpecSchema } from "./schema.js";
5
- import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./test-paths.js";
6
- function readTestSpecFile(filePath) {
7
- const extension = extname(filePath).toLowerCase();
8
- if (!TEST_SPEC_EXTENSIONS.has(extension))
9
- return null;
10
- const parsed = readJsonFileWithSchema(filePath, "test spec", TestSpecSchema);
11
- if (!parsed)
12
- return null;
13
- return {
14
- ...parsed,
15
- id: basename(filePath, extension),
16
- filePath,
17
- };
18
- }
19
- function serializeTestSpec(spec) {
20
- return {
21
- type: spec.type,
22
- name: spec.name,
23
- ...(spec.description ? { description: spec.description } : {}),
24
- cases: spec.cases.map((testCase) => ({
25
- id: testCase.id,
26
- question: testCase.question,
27
- ...(testCase.file ? { file: testCase.file } : {}),
28
- ...(testCase.answer ? { answer: testCase.answer } : {}),
29
- ...(testCase.strictness ? { strictness: testCase.strictness } : {}),
30
- ...(testCase.expect ? { expect: testCase.expect } : {}),
31
- })),
32
- };
33
- }
34
- export function listTestSpecs(sourcePath, type) {
35
- const dirPath = testSpecTypePath(sourcePath, type);
36
- if (!existsSync(dirPath))
37
- return [];
38
- return readdirSync(dirPath)
39
- .map((entry) => join(dirPath, entry))
40
- .filter((filePath) => TEST_SPEC_EXTENSIONS.has(extname(filePath).toLowerCase()))
41
- .map((filePath) => readTestSpecFile(filePath))
42
- .filter((value) => value !== null)
43
- .sort((left, right) => left.name.localeCompare(right.name) || left.id.localeCompare(right.id));
44
- }
45
- export function loadTestSpec(sourcePath, type, id) {
46
- const normalizedId = normalizeTestId(id);
47
- const filePath = join(testSpecTypePath(sourcePath, type), `${normalizedId}.json`);
48
- if (!existsSync(filePath))
49
- return null;
50
- return readTestSpecFile(filePath);
51
- }
52
- export function loadTestSpecFromFile(filePath) {
53
- return readTestSpecFile(filePath);
54
- }
55
- export function writeTestSpec(sourcePath, spec) {
56
- const id = normalizeTestId(spec.id ?? spec.name);
57
- assertTestId(id);
58
- const dirPath = testSpecTypePath(sourcePath, spec.type);
59
- mkdirSync(dirPath, { recursive: true });
60
- const existingPath = join(dirPath, `${id}.json`);
61
- if (existsSync(existingPath)) {
62
- throw new Error(`Test spec already exists: ${existingPath}`);
63
- }
64
- const filePath = testSpecFilePath(sourcePath, spec.type, id);
65
- assertWritableTestSpecPath(filePath);
66
- const normalizedSpec = {
67
- type: spec.type,
68
- name: spec.name.trim(),
69
- ...(spec.description && spec.description.trim().length > 0
70
- ? { description: spec.description.trim() }
71
- : {}),
72
- cases: spec.cases.map((testCase) => ({
73
- id: normalizeTestId(testCase.id),
74
- question: testCase.question.trim(),
75
- ...(testCase.file && testCase.file.trim().length > 0
76
- ? { file: testCase.file.trim() }
77
- : {}),
78
- ...(testCase.answer && testCase.answer.trim().length > 0
79
- ? { answer: testCase.answer.trim() }
80
- : {}),
81
- ...(testCase.strictness && testCase.strictness.trim().length > 0
82
- ? { strictness: testCase.strictness.trim() }
83
- : {}),
84
- ...(testCase.expect
85
- ? {
86
- expect: {
87
- ...(testCase.expect.must_include && testCase.expect.must_include.length > 0
88
- ? { must_include: testCase.expect.must_include.map((value) => value.trim()).filter(Boolean) }
89
- : {}),
90
- ...(testCase.expect.must_include_one_of && testCase.expect.must_include_one_of.length > 0
91
- ? {
92
- must_include_one_of: testCase.expect.must_include_one_of
93
- .map((group) => group.map((value) => value.trim()).filter(Boolean))
94
- .filter((group) => group.length > 0),
95
- }
96
- : {}),
97
- ...(testCase.expect.must_not_include && testCase.expect.must_not_include.length > 0
98
- ? { must_not_include: testCase.expect.must_not_include.map((value) => value.trim()).filter(Boolean) }
99
- : {}),
100
- ...(typeof testCase.expect.min_words === "number"
101
- ? { min_words: testCase.expect.min_words }
102
- : {}),
103
- ...(typeof testCase.expect.max_words === "number"
104
- ? { max_words: testCase.expect.max_words }
105
- : {}),
106
- },
107
- }
108
- : {}),
109
- })),
110
- };
111
- const parsed = TestSpecSchema.parse(normalizedSpec);
112
- writeFileSync(filePath, `${JSON.stringify(serializeTestSpec(parsed), null, 2)}\n`);
113
- return filePath;
114
- }
1
+ // Compatibility shim for historical `src/lib/test-specs.ts` imports.
2
+ // Source of truth: `src/packages/testing/test-specs.ts`.
3
+ export * from "../packages/testing/test-specs.js";
@@ -1,5 +1 @@
1
- import type { TestTargetCandidate } from "./test-types.js";
2
- export declare function listCompiledTestTargets(sourcePath: string): TestTargetCandidate[];
3
- export declare function createCompiledTestTarget(compiledPath: string, compiledName: string, workflowId?: string): TestTargetCandidate;
4
- export declare function createRawTestTarget(sourcePath: string): TestTargetCandidate;
5
- export declare function listTestTargets(sourcePath: string): TestTargetCandidate[];
1
+ export * from "../packages/testing/test-targets.js";