@interf/compiler 0.9.1 → 0.9.4

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 (251) hide show
  1. package/README.md +9 -9
  2. package/agent-skills/interf-actions/SKILL.md +3 -0
  3. package/agent-skills/interf-actions/references/cli.md +13 -13
  4. package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
  5. package/builtin-methods/interf-default/improve/SKILL.md +18 -0
  6. package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
  7. package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
  8. package/dist/cli/commands/check-draft.d.ts +6 -6
  9. package/dist/cli/commands/check-draft.js +5 -5
  10. package/dist/cli/commands/compile-controller.d.ts +7 -7
  11. package/dist/cli/commands/compile-controller.js +35 -38
  12. package/dist/cli/commands/compile.d.ts +3 -3
  13. package/dist/cli/commands/compile.js +23 -21
  14. package/dist/cli/commands/compiled-flow.d.ts +11 -11
  15. package/dist/cli/commands/compiled-flow.js +33 -30
  16. package/dist/cli/commands/create-method-wizard.d.ts +76 -0
  17. package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
  18. package/dist/cli/commands/create.d.ts +3 -3
  19. package/dist/cli/commands/create.js +44 -45
  20. package/dist/cli/commands/default.js +1 -1
  21. package/dist/cli/commands/executor-flow.d.ts +6 -6
  22. package/dist/cli/commands/executor-flow.js +1 -1
  23. package/dist/cli/commands/init.d.ts +2 -2
  24. package/dist/cli/commands/init.js +139 -118
  25. package/dist/cli/commands/list.js +11 -10
  26. package/dist/cli/commands/preparation-selection.d.ts +3 -3
  27. package/dist/cli/commands/source-config-wizard.d.ts +9 -9
  28. package/dist/cli/commands/source-config-wizard.js +43 -43
  29. package/dist/cli/commands/status.js +36 -9
  30. package/dist/cli/commands/test-flow.d.ts +15 -15
  31. package/dist/cli/commands/test-flow.js +29 -219
  32. package/dist/cli/commands/test.d.ts +2 -2
  33. package/dist/cli/commands/test.js +50 -51
  34. package/dist/cli/commands/verify.js +7 -7
  35. package/dist/cli/commands/web.js +41 -28
  36. package/dist/compiler-ui/404.html +1 -0
  37. package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
  38. package/dist/compiler-ui/__next._full.txt +20 -0
  39. package/dist/compiler-ui/__next._head.txt +5 -0
  40. package/dist/compiler-ui/__next._index.txt +5 -0
  41. package/dist/compiler-ui/__next._tree.txt +5 -0
  42. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
  43. package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js} +15 -21
  44. package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +3 -0
  45. package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
  46. package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
  47. package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
  48. package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
  49. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
  50. package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
  51. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
  52. package/dist/compiler-ui/_not-found.html +1 -0
  53. package/dist/compiler-ui/_not-found.txt +15 -0
  54. package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
  55. package/dist/compiler-ui/index.txt +20 -0
  56. package/dist/index.d.ts +8 -6
  57. package/dist/index.js +5 -3
  58. package/dist/packages/agents/index.d.ts +1 -1
  59. package/dist/packages/agents/lib/args.d.ts +2 -2
  60. package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
  61. package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
  62. package/dist/packages/agents/lib/execution-profile.js +7 -6
  63. package/dist/packages/agents/lib/executors.d.ts +13 -13
  64. package/dist/packages/agents/lib/preflight.d.ts +1 -0
  65. package/dist/packages/agents/lib/preflight.js +32 -9
  66. package/dist/packages/agents/lib/shells.d.ts +25 -24
  67. package/dist/packages/agents/lib/shells.js +161 -154
  68. package/dist/packages/agents/lib/types.d.ts +2 -2
  69. package/dist/packages/compiler/artifact-counts.d.ts +1 -0
  70. package/dist/packages/compiler/artifact-counts.js +30 -0
  71. package/dist/packages/compiler/compiled-paths.d.ts +4 -7
  72. package/dist/packages/compiler/compiled-paths.js +9 -15
  73. package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
  74. package/dist/packages/compiler/compiled-pipeline.js +22 -22
  75. package/dist/packages/compiler/compiled-schema.d.ts +20 -20
  76. package/dist/packages/compiler/compiled-schema.js +29 -29
  77. package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
  78. package/dist/packages/compiler/compiled-stage-plan.js +8 -8
  79. package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
  80. package/dist/packages/compiler/compiled-stage-runner.js +7 -7
  81. package/dist/packages/compiler/compiled-target.d.ts +5 -5
  82. package/dist/packages/compiler/compiled-target.js +5 -5
  83. package/dist/packages/compiler/index.d.ts +3 -3
  84. package/dist/packages/compiler/index.js +2 -2
  85. package/dist/packages/compiler/lib/schema.d.ts +62 -247
  86. package/dist/packages/compiler/lib/schema.js +56 -174
  87. package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
  88. package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
  89. package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
  90. package/dist/packages/compiler/raw-snapshot.js +0 -1
  91. package/dist/packages/compiler/reset.js +3 -3
  92. package/dist/packages/compiler/runtime-acceptance.js +9 -16
  93. package/dist/packages/compiler/runtime-contracts.js +9 -9
  94. package/dist/packages/compiler/runtime-prompt.js +4 -4
  95. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
  96. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  97. package/dist/packages/compiler/runtime-runs.js +9 -9
  98. package/dist/packages/compiler/runtime-types.d.ts +8 -7
  99. package/dist/packages/compiler/state-health.js +26 -35
  100. package/dist/packages/compiler/state-view.js +6 -6
  101. package/dist/packages/compiler/validate-compiled.d.ts +5 -5
  102. package/dist/packages/compiler/validate-compiled.js +56 -64
  103. package/dist/packages/compiler/validate.d.ts +2 -2
  104. package/dist/packages/compiler/validate.js +22 -14
  105. package/dist/packages/contracts/index.d.ts +2 -0
  106. package/dist/packages/contracts/index.js +1 -0
  107. package/dist/packages/contracts/lib/schema.d.ts +205 -0
  108. package/dist/packages/contracts/lib/schema.js +101 -0
  109. package/dist/packages/execution/index.d.ts +2 -2
  110. package/dist/packages/execution/index.js +1 -1
  111. package/dist/packages/execution/lib/schema.d.ts +80 -83
  112. package/dist/packages/execution/lib/schema.js +25 -48
  113. package/dist/packages/local-service/action-values.d.ts +1 -1
  114. package/dist/packages/local-service/action-values.js +1 -1
  115. package/dist/packages/local-service/client.d.ts +4 -4
  116. package/dist/packages/local-service/client.js +4 -4
  117. package/dist/packages/local-service/index.d.ts +3 -3
  118. package/dist/packages/local-service/index.js +2 -2
  119. package/dist/packages/local-service/lib/schema.d.ts +540 -974
  120. package/dist/packages/local-service/lib/schema.js +44 -160
  121. package/dist/packages/local-service/run-observability.d.ts +6 -0
  122. package/dist/packages/local-service/run-observability.js +592 -0
  123. package/dist/packages/local-service/runtime.d.ts +19 -23
  124. package/dist/packages/local-service/runtime.js +349 -913
  125. package/dist/packages/local-service/server.d.ts +1 -0
  126. package/dist/packages/local-service/server.js +25 -20
  127. package/dist/packages/method-authoring/index.d.ts +4 -0
  128. package/dist/packages/method-authoring/index.js +4 -0
  129. package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
  130. package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
  131. package/dist/packages/method-authoring/method-authoring.js +116 -0
  132. package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
  133. package/dist/packages/method-authoring/method-edit-session.js +125 -0
  134. package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
  135. package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
  136. package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
  137. package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
  138. package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
  139. package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
  140. package/dist/packages/method-package/index.d.ts +11 -0
  141. package/dist/packages/method-package/index.js +11 -0
  142. package/dist/packages/method-package/interf-method-package.d.ts +31 -0
  143. package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
  144. package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
  145. package/dist/packages/method-package/local-methods.d.ts +64 -0
  146. package/dist/packages/method-package/local-methods.js +466 -0
  147. package/dist/packages/method-package/method-definitions.d.ts +83 -0
  148. package/dist/packages/method-package/method-definitions.js +205 -0
  149. package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
  150. package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
  151. package/dist/packages/method-package/method-review-paths.d.ts +10 -0
  152. package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
  153. package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
  154. package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
  155. package/dist/packages/methods/index.d.ts +2 -0
  156. package/dist/packages/methods/index.js +2 -0
  157. package/dist/packages/methods/method-resolution.d.ts +6 -0
  158. package/dist/packages/methods/method-resolution.js +7 -0
  159. package/dist/packages/project-model/index.d.ts +1 -4
  160. package/dist/packages/project-model/index.js +0 -3
  161. package/dist/packages/project-model/interf-detect.d.ts +1 -5
  162. package/dist/packages/project-model/interf-detect.js +7 -18
  163. package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
  164. package/dist/packages/project-model/interf-scaffold.js +38 -39
  165. package/dist/packages/project-model/interf.d.ts +1 -2
  166. package/dist/packages/project-model/interf.js +1 -2
  167. package/dist/packages/project-model/lib/schema.d.ts +2 -66
  168. package/dist/packages/project-model/lib/schema.js +5 -23
  169. package/dist/packages/project-model/project-paths.d.ts +9 -10
  170. package/dist/packages/project-model/project-paths.js +14 -17
  171. package/dist/packages/project-model/source-config.d.ts +11 -18
  172. package/dist/packages/project-model/source-config.js +42 -60
  173. package/dist/packages/project-model/source-folders.d.ts +4 -4
  174. package/dist/packages/project-model/source-folders.js +10 -10
  175. package/dist/packages/testing/index.d.ts +2 -2
  176. package/dist/packages/testing/index.js +1 -1
  177. package/dist/packages/testing/lib/schema.d.ts +11 -11
  178. package/dist/packages/testing/lib/schema.js +8 -9
  179. package/dist/packages/testing/readiness-check-run.d.ts +67 -0
  180. package/dist/packages/testing/readiness-check-run.js +258 -0
  181. package/dist/packages/testing/test-execution.d.ts +3 -3
  182. package/dist/packages/testing/test-execution.js +5 -5
  183. package/dist/packages/testing/test-paths.js +6 -6
  184. package/dist/packages/testing/test-profile-presets.js +2 -2
  185. package/dist/packages/testing/test-sandbox.js +10 -11
  186. package/dist/packages/testing/test-targets.d.ts +1 -1
  187. package/dist/packages/testing/test-targets.js +8 -7
  188. package/dist/packages/testing/test-types.d.ts +1 -1
  189. package/package.json +16 -33
  190. package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
  191. package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +0 -3
  192. package/builtin-workflows/interf/improve/SKILL.md +0 -18
  193. package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
  194. package/dist/packages/project-model/compiled-paths.d.ts +0 -1
  195. package/dist/packages/project-model/compiled-paths.js +0 -1
  196. package/dist/packages/project-model/compiled-raw.d.ts +0 -1
  197. package/dist/packages/project-model/compiled-raw.js +0 -1
  198. package/dist/packages/project-model/compiled-reset.d.ts +0 -1
  199. package/dist/packages/project-model/compiled-reset.js +0 -1
  200. package/dist/packages/shared/index.d.ts +0 -7
  201. package/dist/packages/shared/index.js +0 -7
  202. package/dist/packages/shared/util.d.ts +0 -3
  203. package/dist/packages/shared/util.js +0 -3
  204. package/dist/packages/testing/test-matrices.d.ts +0 -90
  205. package/dist/packages/testing/test-matrices.js +0 -96
  206. package/dist/packages/workflow-authoring/index.d.ts +0 -4
  207. package/dist/packages/workflow-authoring/index.js +0 -4
  208. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
  209. package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
  210. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
  211. package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
  212. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
  213. package/dist/packages/workflow-package/index.d.ts +0 -11
  214. package/dist/packages/workflow-package/index.js +0 -11
  215. package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
  216. package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
  217. package/dist/packages/workflow-package/local-workflows.js +0 -457
  218. package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
  219. package/dist/packages/workflow-package/workflow-definitions.js +0 -211
  220. package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
  221. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
  222. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
  223. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
  224. /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
  225. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
  226. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
  227. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
  228. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
  229. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
  230. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
  231. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
  232. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
  233. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
  234. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
  235. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
  236. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
  237. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
  238. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
  239. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
  240. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_buildManifest.js +0 -0
  241. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_clientMiddlewareManifest.js +0 -0
  242. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_ssgManifest.js +0 -0
  243. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  244. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  245. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
  246. /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
  247. /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
  248. /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
  249. /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
  250. /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
  251. /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
@@ -3,9 +3,10 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
3
  import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
5
5
  import { readInterfConfig, } from "./interf.js";
6
- import { seedCompiledWorkflowPackage } from "../workflow-package/interf-workflow-package.js";
6
+ import { seedCompiledMethodPackage } from "../method-package/interf-method-package.js";
7
7
  import { readJsonFileWithSchema } from "../shared/parse.js";
8
- import { getCompiledWorkflow } from "../workflow-package/workflow-definitions.js";
8
+ import { getCompiledMethod } from "../method-package/method-definitions.js";
9
+ import { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, } from "../methods/method-resolution.js";
9
10
  import { SourceFolderConfigSchema, } from "./lib/schema.js";
10
11
  import { slugify } from "../shared/naming.js";
11
12
  import { assertPathWithinRoot, isPathWithinRoot } from "../shared/path-guards.js";
@@ -60,9 +61,7 @@ export function loadSourceFolderConfig(sourcePath) {
60
61
  return null;
61
62
  return readSourceFolderConfigFile(filePath);
62
63
  }
63
- export function methodIdForSourcePreparationConfig(preparationConfig) {
64
- return preparationConfig?.method ?? preparationConfig?.workflow ?? null;
65
- }
64
+ export { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig } from "../methods/method-resolution.js";
66
65
  function normalizeSourcePreparationConfig(preparationConfig) {
67
66
  const method = methodIdForSourcePreparationConfig(preparationConfig);
68
67
  return {
@@ -71,15 +70,10 @@ function normalizeSourcePreparationConfig(preparationConfig) {
71
70
  };
72
71
  }
73
72
  export function listSourcePreparationConfigs(config) {
74
- const explicitPreparations = config?.preparations ?? [];
75
- const preparations = explicitPreparations.length > 0
76
- ? explicitPreparations
77
- : config?.datasets ?? [];
78
- return preparations.map((preparation) => normalizeSourcePreparationConfig(preparation));
73
+ return (config?.preparations ?? []).map((preparation) => normalizeSourcePreparationConfig(preparation));
79
74
  }
80
- export const listSourceDatasetConfigs = listSourcePreparationConfigs;
81
- export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null) {
82
- const configured = override ?? datasetConfig.max_attempts ?? null;
75
+ export function resolvePreparationCompileMaxAttempts(preparationConfig, override = null) {
76
+ const configured = override ?? preparationConfig.max_attempts ?? null;
83
77
  if (configured == null)
84
78
  return null;
85
79
  const normalized = Math.trunc(configured);
@@ -87,8 +81,8 @@ export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null)
87
81
  return 1;
88
82
  return Math.min(5, normalized);
89
83
  }
90
- export function resolveDatasetCompileMaxLoops(datasetConfig, override = null) {
91
- const configured = override ?? datasetConfig.max_loops ?? null;
84
+ export function resolvePreparationCompileMaxLoops(preparationConfig, override = null) {
85
+ const configured = override ?? preparationConfig.max_loops ?? null;
92
86
  if (configured == null)
93
87
  return null;
94
88
  const normalized = Math.trunc(configured);
@@ -100,11 +94,9 @@ export function getDefaultSourcePreparationConfig(config) {
100
94
  const preparations = listSourcePreparationConfigs(config);
101
95
  return preparations[0] ?? null;
102
96
  }
103
- export const getDefaultSourceDatasetConfig = getDefaultSourcePreparationConfig;
104
97
  export function findSourcePreparationConfig(config, preparationName) {
105
98
  return listSourcePreparationConfigs(config).find((preparation) => preparation.name === preparationName) ?? null;
106
99
  }
107
- export const findSourceDatasetConfig = findSourcePreparationConfig;
108
100
  export function configuredSourceFolderPath(config) {
109
101
  return config?.source_folder?.path ?? null;
110
102
  }
@@ -113,10 +105,7 @@ export function resolveConfiguredSourceFolderPath(sourcePath, config = loadSourc
113
105
  return configuredPath ? resolve(sourcePath, configuredPath) : null;
114
106
  }
115
107
  function toWritableSourceProjectConfig(config) {
116
- const explicitPreparations = config?.preparations ?? [];
117
- const preparations = explicitPreparations.length > 0
118
- ? explicitPreparations
119
- : config?.datasets ?? [];
108
+ const preparations = config?.preparations ?? [];
120
109
  const sourceFolder = config?.source_folder;
121
110
  if (preparations.length > 0) {
122
111
  return {
@@ -135,13 +124,12 @@ function toWritableSourcePreparationConfig(preparation) {
135
124
  name: preparation.name,
136
125
  path: preparation.path,
137
126
  ...(preparation.about ? { about: preparation.about } : {}),
138
- ...(method && method !== "interf" ? { method } : {}),
127
+ method: method ?? DEFAULT_METHOD_ID,
139
128
  ...(typeof preparation.max_attempts === "number" ? { max_attempts: preparation.max_attempts } : {}),
140
129
  ...(typeof preparation.max_loops === "number" ? { max_loops: preparation.max_loops } : {}),
141
130
  checks: preparation.checks,
142
131
  };
143
132
  }
144
- const toWritableSourceDatasetConfig = toWritableSourcePreparationConfig;
145
133
  export function saveSourceFolderConfig(sourcePath, config) {
146
134
  const existing = loadSourceFolderConfig(sourcePath);
147
135
  const mergedConfig = {
@@ -151,7 +139,7 @@ export function saveSourceFolderConfig(sourcePath, config) {
151
139
  mkdirSync(projectInterfRoot(sourcePath), { recursive: true });
152
140
  writeFileSync(sourceFolderConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(mergedConfig), null, 2) + "\n");
153
141
  }
154
- export function appendSourceDatasetChecks(sourcePath, preparationName, checks) {
142
+ export function appendSourcePreparationChecks(sourcePath, preparationName, checks) {
155
143
  const existing = loadSourceFolderConfig(sourcePath);
156
144
  const currentPreparation = findSourcePreparationConfig(existing, preparationName);
157
145
  const otherPreparations = listSourcePreparationConfigs(existing).filter((preparation) => preparation.name !== preparationName);
@@ -171,8 +159,7 @@ export function appendSourceDatasetChecks(sourcePath, preparationName, checks) {
171
159
  ],
172
160
  });
173
161
  }
174
- export const appendSourcePreparationChecks = appendSourceDatasetChecks;
175
- export function upsertSourceDatasetConfig(sourcePath, preparationConfig, options = {}) {
162
+ export function upsertSourcePreparationConfig(sourcePath, preparationConfig, options = {}) {
176
163
  const existing = loadSourceFolderConfig(sourcePath);
177
164
  const preparations = listSourcePreparationConfigs(existing);
178
165
  const candidateNames = Array.from(new Set([preparationConfig.name, options.matchName].filter((value) => Boolean(value))));
@@ -187,24 +174,22 @@ export function upsertSourceDatasetConfig(sourcePath, preparationConfig, options
187
174
  preparations,
188
175
  });
189
176
  }
190
- export const upsertSourcePreparationConfig = upsertSourceDatasetConfig;
191
177
  export function compiledMaxAttempts(maxAttempts) {
192
178
  if (maxAttempts == null)
193
179
  return undefined;
194
- return resolveDatasetCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
180
+ return resolvePreparationCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
195
181
  }
196
182
  export function compiledMaxLoops(maxLoops) {
197
183
  if (maxLoops == null)
198
184
  return undefined;
199
- return resolveDatasetCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
185
+ return resolvePreparationCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
200
186
  }
201
- export function sourceDatasetConfigFromInterfConfig(config, preparationPath = `./${config.name}`) {
202
- const method = config.method ?? config.workflow;
187
+ export function sourcePreparationConfigFromInterfConfig(config, preparationPath = `./${config.name}`) {
203
188
  return {
204
189
  name: config.name,
205
190
  path: preparationPath,
206
191
  ...(config.about ? { about: config.about } : {}),
207
- ...(method ? { method } : {}),
192
+ method: config.method,
208
193
  ...(typeof config.max_attempts === "number"
209
194
  ? { max_attempts: config.max_attempts }
210
195
  : {}),
@@ -214,7 +199,7 @@ export function sourceDatasetConfigFromInterfConfig(config, preparationPath = `.
214
199
  checks: config.checks ?? [],
215
200
  };
216
201
  }
217
- export function loadCompiledDatasetConfig(compiledPath) {
202
+ export function loadCompiledPreparationConfig(compiledPath) {
218
203
  const config = readInterfConfig(compiledPath);
219
204
  if (!config)
220
205
  return null;
@@ -225,11 +210,7 @@ export function loadCompiledDatasetConfig(compiledPath) {
225
210
  : `./${config.name}`;
226
211
  const sourceBinding = typeof config.source?.preparation_path === "string" && config.source.preparation_path.length > 0
227
212
  ? config.source.preparation_path
228
- : typeof config.source?.source_folder_path === "string" && config.source.source_folder_path.length > 0
229
- ? config.source.source_folder_path
230
- : typeof config.source?.dataset_path === "string" && config.source.dataset_path.length > 0
231
- ? config.source.dataset_path
232
- : null;
213
+ : null;
233
214
  const preparationPath = sourceBinding
234
215
  ? (() => {
235
216
  const sourceAbsolutePath = resolve(compiledPath, sourceBinding);
@@ -239,19 +220,21 @@ export function loadCompiledDatasetConfig(compiledPath) {
239
220
  return relative(projectPath, sourceAbsolutePath).split(sep).join("/") || defaultPreparationPath;
240
221
  })()
241
222
  : defaultPreparationPath;
242
- return sourceDatasetConfigFromInterfConfig(config, preparationPath);
223
+ return sourcePreparationConfigFromInterfConfig(config, preparationPath);
243
224
  }
244
225
  export function saveCompiledInterfConfig(compiledPath, config) {
245
226
  mkdirSync(compiledInterfRoot(compiledPath), { recursive: true });
246
227
  writeFileSync(compiledInterfConfigPath(compiledPath), JSON.stringify(config, null, 2) + "\n");
247
228
  return config;
248
229
  }
249
- export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, datasetConfig) {
230
+ export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath, preparationConfig) {
250
231
  const current = readInterfConfig(compiledPath);
251
232
  const projectPath = resolveSourceControlPathForCompiled(compiledPath);
252
- const datasetAbsolutePath = resolveSourceDatasetPath(projectPath, datasetConfig);
253
- const datasetRelativePath = relative(compiledPath, datasetAbsolutePath).split(sep).join("/") || ".";
254
- const methodId = methodIdForSourcePreparationConfig(datasetConfig) ?? current?.method ?? current?.workflow ?? "interf";
233
+ const preparationAbsolutePath = resolveSourcePreparationPath(projectPath, preparationConfig);
234
+ const preparationRelativePath = relative(compiledPath, preparationAbsolutePath).split(sep).join("/") || ".";
235
+ const methodId = methodIdForSourcePreparationConfig(preparationConfig)
236
+ ?? methodIdForSourcePreparationConfig(current)
237
+ ?? DEFAULT_METHOD_ID;
255
238
  const methodChanged = current?.method !== undefined && current.method !== methodId;
256
239
  const methodOrigin = methodChanged || !current?.method_origin
257
240
  ? {
@@ -259,7 +242,7 @@ export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, da
259
242
  local_draft: false,
260
243
  }
261
244
  : current.method_origin;
262
- const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, method: _ignoredMethod, workflow: _ignoredWorkflow, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, method_origin: _ignoredMethodOrigin, workflow_origin: _ignoredWorkflowOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
245
+ const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, method: _ignoredMethod, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, method_origin: _ignoredMethodOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
263
246
  const nextConfig = {
264
247
  ...passthrough,
265
248
  ...(!current ? {
@@ -269,31 +252,31 @@ export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, da
269
252
  },
270
253
  } : {}),
271
254
  type: "compiled",
272
- name: datasetConfig.name,
273
- ...(datasetConfig.about ? { about: datasetConfig.about } : {}),
255
+ name: preparationConfig.name,
256
+ ...(preparationConfig.about ? { about: preparationConfig.about } : {}),
274
257
  method: methodId,
275
- ...(typeof datasetConfig.max_attempts === "number"
276
- ? { max_attempts: datasetConfig.max_attempts }
258
+ ...(typeof preparationConfig.max_attempts === "number"
259
+ ? { max_attempts: preparationConfig.max_attempts }
277
260
  : {}),
278
- ...(typeof datasetConfig.max_loops === "number"
279
- ? { max_loops: datasetConfig.max_loops }
261
+ ...(typeof preparationConfig.max_loops === "number"
262
+ ? { max_loops: preparationConfig.max_loops }
280
263
  : {}),
281
- checks: datasetConfig.checks,
264
+ checks: preparationConfig.checks,
282
265
  method_origin: methodOrigin,
283
266
  source: {
284
267
  path: current?.source?.path ?? "./raw",
285
268
  control_path: defaultControlPathForCompiled(compiledPath),
286
- preparation_path: datasetRelativePath,
269
+ preparation_path: preparationRelativePath,
287
270
  },
288
271
  };
289
272
  const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
290
273
  if (methodChanged) {
291
274
  const sourcePath = projectPath;
292
- const selectedWorkflow = getCompiledWorkflow(methodId, { sourcePath });
293
- seedCompiledWorkflowPackage({
275
+ const selectedMethod = getCompiledMethod(methodId, { sourcePath });
276
+ seedCompiledMethodPackage({
294
277
  compiledPath,
295
278
  sourcePath,
296
- workflowId: selectedWorkflow.id,
279
+ methodId: selectedMethod.id,
297
280
  });
298
281
  }
299
282
  refreshCompiledBootstrapGuidance(compiledPath);
@@ -340,7 +323,7 @@ export function buildTestSpecFromSourceFolderConfig(options) {
340
323
  defaultDescription: `Derived from saved Preparation checks in ${SOURCE_FOLDER_CONFIG_PATH}`,
341
324
  });
342
325
  }
343
- export function buildTestSpecFromCompiledDatasetConfig(options) {
326
+ export function buildTestSpecFromCompiledPreparationConfig(options) {
344
327
  const { compiledPath, targetType = "compiled" } = options;
345
328
  const config = readInterfConfig(compiledPath);
346
329
  const configPath = compiledInterfConfigPath(compiledPath);
@@ -354,15 +337,14 @@ export function buildTestSpecFromCompiledDatasetConfig(options) {
354
337
  filePath: targetType === "raw"
355
338
  ? `${configPath}#checks:file-as-is`
356
339
  : `${configPath}#checks:compiled`,
357
- defaultDescription: "Derived from checks in the compiled context config.",
340
+ defaultDescription: "Derived from checks in the portable context config.",
358
341
  });
359
342
  }
360
- export function resolveSourceDatasetPath(projectPath, datasetConfig) {
361
- const configuredPath = datasetConfig.path.trim();
343
+ export function resolveSourcePreparationPath(projectPath, preparationConfig) {
344
+ const configuredPath = preparationConfig.path.trim();
362
345
  const resolvedPath = resolve(projectPath, configuredPath);
363
346
  if (isAbsolute(configuredPath)) {
364
347
  return resolvedPath;
365
348
  }
366
349
  return assertPathWithinRoot(projectPath, resolvedPath, "Source folder path");
367
350
  }
368
- export const resolveSourcePreparationPath = resolveSourceDatasetPath;
@@ -1,11 +1,11 @@
1
1
  export declare function listVisibleSourceFolders(projectPath: string): string[];
2
- export declare function isReservedSourceDatasetPath(relativePath: string): boolean;
3
- export declare function normalizeSourceDatasetPathForConfig(projectPath: string, value: string): string;
4
- export declare function defaultDatasetNameForPath(datasetPath: string): string;
2
+ export declare function isReservedSourcePreparationPath(relativePath: string): boolean;
3
+ export declare function normalizeSourcePreparationPathForConfig(projectPath: string, value: string): string;
4
+ export declare function defaultPreparationNameForPath(sourceFolderPath: string): string;
5
5
  export declare function findSingleSourceFolderCandidate(projectPath: string): string | null;
6
6
  export declare function listSourceFolderChoices(projectPath?: string): Array<{
7
7
  value: string;
8
8
  label: string;
9
9
  hint: string;
10
10
  }>;
11
- export declare function defaultSourceDatasetPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", projectPath?: string): string;
11
+ export declare function defaultSourcePreparationPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", projectPath?: string): string;
@@ -1,9 +1,9 @@
1
1
  import { existsSync, readdirSync, statSync } from "node:fs";
2
2
  import { isAbsolute, join, relative, sep } from "node:path";
3
3
  import { slugify } from "../shared/naming.js";
4
- import { resolveSourceDatasetPath } from "./source-config.js";
4
+ import { resolveSourcePreparationPath } from "./source-config.js";
5
5
  import { isPathWithinRoot } from "../shared/path-guards.js";
6
- const DEFAULT_DATASET_NAME = "dataset1";
6
+ const DEFAULT_PREPARATION_NAME = "default";
7
7
  const IGNORED_SOURCE_FOLDER_ENTRIES = new Set([
8
8
  ".DS_Store",
9
9
  ".git",
@@ -35,16 +35,16 @@ export function listVisibleSourceFolders(projectPath) {
35
35
  }
36
36
  return visibleDirectories.sort((left, right) => left.localeCompare(right));
37
37
  }
38
- export function isReservedSourceDatasetPath(relativePath) {
38
+ export function isReservedSourcePreparationPath(relativePath) {
39
39
  const normalized = relativePath.replace(/\\/g, "/").replace(/^\.\/+/, "");
40
40
  return normalized === "interf" ||
41
41
  normalized.startsWith("interf/") ||
42
42
  normalized === ".interf" ||
43
43
  normalized.startsWith(".interf/");
44
44
  }
45
- export function normalizeSourceDatasetPathForConfig(projectPath, value) {
45
+ export function normalizeSourcePreparationPathForConfig(projectPath, value) {
46
46
  const trimmedValue = value.trim();
47
- const resolvedPath = resolveSourceDatasetPath(projectPath, { path: trimmedValue });
47
+ const resolvedPath = resolveSourcePreparationPath(projectPath, { path: trimmedValue });
48
48
  const relativePath = relative(projectPath, resolvedPath).split(sep).join("/") || ".";
49
49
  if (relativePath === ".") {
50
50
  throw new Error("Pick a Source Folder, not the Interf Workspace itself.");
@@ -58,7 +58,7 @@ export function normalizeSourceDatasetPathForConfig(projectPath, value) {
58
58
  }
59
59
  return resolvedPath;
60
60
  }
61
- if (isReservedSourceDatasetPath(relativePath)) {
61
+ if (isReservedSourcePreparationPath(relativePath)) {
62
62
  throw new Error("Pick an existing source folder, not `interf/` or `.interf/`.");
63
63
  }
64
64
  if (!existsSync(resolvedPath)) {
@@ -69,13 +69,13 @@ export function normalizeSourceDatasetPathForConfig(projectPath, value) {
69
69
  }
70
70
  return relativePath.startsWith("./") ? relativePath : `./${relativePath}`;
71
71
  }
72
- export function defaultDatasetNameForPath(datasetPath) {
73
- const segments = datasetPath
72
+ export function defaultPreparationNameForPath(sourceFolderPath) {
73
+ const segments = sourceFolderPath
74
74
  .replace(/\\/g, "/")
75
75
  .replace(/\/+$/g, "")
76
76
  .split("/")
77
77
  .filter((segment) => segment.length > 0 && segment !== ".");
78
- return slugify(segments[segments.length - 1] ?? "") || DEFAULT_DATASET_NAME;
78
+ return slugify(segments[segments.length - 1] ?? "") || DEFAULT_PREPARATION_NAME;
79
79
  }
80
80
  export function findSingleSourceFolderCandidate(projectPath) {
81
81
  const visibleDirectories = listVisibleSourceFolders(projectPath);
@@ -91,7 +91,7 @@ export function listSourceFolderChoices(projectPath = process.cwd()) {
91
91
  hint: `Use ./${entry} as the source folder`,
92
92
  }));
93
93
  }
94
- export function defaultSourceDatasetPathForPrompt(name, introStyle, projectPath = process.cwd()) {
94
+ export function defaultSourcePreparationPathForPrompt(name, introStyle, projectPath = process.cwd()) {
95
95
  const namedFolderPath = join(projectPath, name);
96
96
  if (existsSync(namedFolderPath)) {
97
97
  try {
@@ -1,13 +1,13 @@
1
1
  export * as schema from "./lib/schema.js";
2
2
  export * as test from "./test.js";
3
3
  export * as execution from "./test-execution.js";
4
- export * as matrices from "./test-matrices.js";
5
4
  export * as paths from "./test-paths.js";
6
5
  export * as profilePresets from "./test-profile-presets.js";
6
+ export * as readinessCheckRun from "./readiness-check-run.js";
7
7
  export * as sandbox from "./test-sandbox.js";
8
8
  export * as specs from "./test-specs.js";
9
9
  export * as targets from "./test-targets.js";
10
10
  export * as types from "./test-types.js";
11
- export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun, TestRunComparison, TestTargetType, } from "./lib/schema.js";
11
+ export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun, ReadinessCheckRun, TestTargetType, } from "./lib/schema.js";
12
12
  export type { LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
13
13
  export type { TestSandboxRetentionMode, } from "./test-sandbox.js";
@@ -1,9 +1,9 @@
1
1
  export * as schema from "./lib/schema.js";
2
2
  export * as test from "./test.js";
3
3
  export * as execution from "./test-execution.js";
4
- export * as matrices from "./test-matrices.js";
5
4
  export * as paths from "./test-paths.js";
6
5
  export * as profilePresets from "./test-profile-presets.js";
6
+ export * as readinessCheckRun from "./readiness-check-run.js";
7
7
  export * as sandbox from "./test-sandbox.js";
8
8
  export * as specs from "./test-specs.js";
9
9
  export * as targets from "./test-targets.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type TestCaseExpect, type TestTargetType } from "../../compiler/lib/schema.js";
2
+ import { type TestCaseExpect, type TestTargetType } from "../../contracts/lib/schema.js";
3
3
  export declare const TestCaseSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  question: z.ZodString;
@@ -65,7 +65,7 @@ export declare const TestTargetResultSchema: z.ZodObject<{
65
65
  }>;
66
66
  name: z.ZodString;
67
67
  path: z.ZodString;
68
- workflow: z.ZodString;
68
+ method: z.ZodString;
69
69
  }, z.core.$strip>;
70
70
  sandbox_path: z.ZodOptional<z.ZodString>;
71
71
  ok: z.ZodBoolean;
@@ -143,7 +143,7 @@ export declare const TestTargetRunSchema: z.ZodObject<{
143
143
  }>;
144
144
  name: z.ZodString;
145
145
  path: z.ZodString;
146
- workflow: z.ZodString;
146
+ method: z.ZodString;
147
147
  }, z.core.$strip>;
148
148
  sandbox_path: z.ZodOptional<z.ZodString>;
149
149
  ok: z.ZodBoolean;
@@ -189,11 +189,11 @@ export declare const TestRunTargetSummarySchema: z.ZodObject<{
189
189
  }>;
190
190
  name: z.ZodString;
191
191
  path: z.ZodString;
192
- workflow: z.ZodString;
192
+ method: z.ZodString;
193
193
  }, z.core.$strip>;
194
194
  }, z.core.$strip>;
195
- export declare const TestRunComparisonSchema: z.ZodObject<{
196
- kind: z.ZodLiteral<"interf-test-run">;
195
+ export declare const ReadinessCheckRunSchema: z.ZodObject<{
196
+ kind: z.ZodLiteral<"interf-readiness-check-run">;
197
197
  version: z.ZodLiteral<1>;
198
198
  generated_at: z.ZodString;
199
199
  mode: z.ZodEnum<{
@@ -203,9 +203,9 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
203
203
  }>;
204
204
  source_path: z.ZodString;
205
205
  checks_fingerprint: z.ZodOptional<z.ZodString>;
206
- dataset: z.ZodObject<{
206
+ preparation: z.ZodObject<{
207
207
  name: z.ZodString;
208
- compiled_path: z.ZodNullable<z.ZodString>;
208
+ portable_context_path: z.ZodNullable<z.ZodString>;
209
209
  }, z.core.$strip>;
210
210
  raw: z.ZodNullable<z.ZodObject<{
211
211
  label: z.ZodString;
@@ -222,7 +222,7 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
222
222
  }>;
223
223
  name: z.ZodString;
224
224
  path: z.ZodString;
225
- workflow: z.ZodString;
225
+ method: z.ZodString;
226
226
  }, z.core.$strip>;
227
227
  }, z.core.$strip>>;
228
228
  compiled: z.ZodNullable<z.ZodObject<{
@@ -240,7 +240,7 @@ export declare const TestRunComparisonSchema: z.ZodObject<{
240
240
  }>;
241
241
  name: z.ZodString;
242
242
  path: z.ZodString;
243
- workflow: z.ZodString;
243
+ method: z.ZodString;
244
244
  }, z.core.$strip>;
245
245
  }, z.core.$strip>>;
246
246
  summary: z.ZodObject<{
@@ -258,4 +258,4 @@ export type TestTargetResult = z.infer<typeof TestTargetResultSchema>;
258
258
  export type TestTargetRun = z.infer<typeof TestTargetRunSchema>;
259
259
  export type TestRunMode = z.infer<typeof TestRunModeSchema>;
260
260
  export type TestRunTargetSummary = z.infer<typeof TestRunTargetSummarySchema>;
261
- export type TestRunComparison = z.infer<typeof TestRunComparisonSchema>;
261
+ export type ReadinessCheckRun = z.infer<typeof ReadinessCheckRunSchema>;
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, } from "../../compiler/lib/schema.js";
3
- import { DatasetNameSchema } from "../../project-model/lib/schema.js";
2
+ import { RuntimeExecutorInfoSchema, TestCaseExpectSchema, TestTargetTypeSchema, PreparationNameSchema, } from "../../contracts/lib/schema.js";
4
3
  const TestCaseCoreSchema = z.object({
5
4
  id: z.string().regex(/^[a-z0-9][a-z0-9-]{0,79}$/),
6
5
  question: z.string().min(1),
@@ -47,7 +46,7 @@ export const TestTargetResultSchema = z.object({
47
46
  type: TestTargetTypeSchema,
48
47
  name: z.string(),
49
48
  path: z.string(),
50
- workflow: z.string(),
49
+ method: z.string(),
51
50
  }),
52
51
  sandbox_path: z.string().optional(),
53
52
  ok: z.boolean(),
@@ -95,19 +94,19 @@ export const TestRunTargetSummarySchema = z.object({
95
94
  type: TestTargetTypeSchema,
96
95
  name: z.string(),
97
96
  path: z.string(),
98
- workflow: z.string(),
97
+ method: z.string(),
99
98
  }),
100
99
  });
101
- export const TestRunComparisonSchema = z.object({
102
- kind: z.literal("interf-test-run"),
100
+ export const ReadinessCheckRunSchema = z.object({
101
+ kind: z.literal("interf-readiness-check-run"),
103
102
  version: z.literal(1),
104
103
  generated_at: z.string(),
105
104
  mode: TestRunModeSchema,
106
105
  source_path: z.string(),
107
106
  checks_fingerprint: z.string().min(1).optional(),
108
- dataset: z.object({
109
- name: DatasetNameSchema,
110
- compiled_path: z.string().nullable(),
107
+ preparation: z.object({
108
+ name: PreparationNameSchema,
109
+ portable_context_path: z.string().nullable(),
111
110
  }),
112
111
  raw: TestRunTargetSummarySchema.nullable(),
113
112
  compiled: TestRunTargetSummarySchema.nullable(),
@@ -0,0 +1,67 @@
1
+ import type { MethodExecutor } from "../agents/lib/executors.js";
2
+ import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
3
+ import { type TestTargetCandidate, type TestTargetResult } from "./test.js";
4
+ import type { TestSandboxRetentionMode } from "./test-sandbox.js";
5
+ import { type ReadinessCheckRun, type TestRunMode } from "./lib/schema.js";
6
+ export interface SavedReadinessCheckOutcome {
7
+ runPath: string;
8
+ displayRunPath?: string;
9
+ target: TestTargetCandidate;
10
+ result: TestTargetResult;
11
+ }
12
+ export interface ReadinessCheckRunResult {
13
+ sourcePath: string;
14
+ preparationConfig: SourcePreparationConfig;
15
+ portableContextPath: string | null;
16
+ mode: TestRunMode;
17
+ rawOutcome: SavedReadinessCheckOutcome | null;
18
+ compiledOutcome: SavedReadinessCheckOutcome | null;
19
+ comparisonRunPath: string | null;
20
+ comparison: ReadinessCheckRun | null;
21
+ }
22
+ export declare function readinessPassRate(outcome: SavedReadinessCheckOutcome): number;
23
+ export declare function readSavedReadinessCheckRun(projectPath: string, preparationName: string): ReadinessCheckRun | null;
24
+ export declare function parseReadinessCheckRun(value: unknown): ReadinessCheckRun | null;
25
+ export declare function readReadinessCheckRunAtPath(filePath: string, label?: string): ReadinessCheckRun | null;
26
+ export declare function readCurrentSavedReadinessCheckRun(options: {
27
+ projectPath: string;
28
+ preparationName: string;
29
+ checks: SourcePreparationConfig["checks"];
30
+ }): {
31
+ comparison: ReadinessCheckRun | null;
32
+ stale: boolean;
33
+ };
34
+ export declare function saveReadinessCheckRun(options: {
35
+ sourcePath: string;
36
+ portableContextPath: string | null;
37
+ preparationName: string;
38
+ checksFingerprint: string;
39
+ mode: TestRunMode;
40
+ rawOutcome: SavedReadinessCheckOutcome | null;
41
+ compiledOutcome: SavedReadinessCheckOutcome | null;
42
+ }): string;
43
+ export declare function runSavedSourceFilesCheck(options: {
44
+ sourcePath: string;
45
+ preparationConfig: SourcePreparationConfig;
46
+ executor?: MethodExecutor | null;
47
+ preserveSandboxes?: TestSandboxRetentionMode;
48
+ runSuffix?: string | null;
49
+ }): Promise<SavedReadinessCheckOutcome | null>;
50
+ export declare function runSavedPortableContextCheck(options: {
51
+ sourcePath: string;
52
+ preparationConfig: SourcePreparationConfig;
53
+ executor?: MethodExecutor | null;
54
+ portableContextPath?: string | null;
55
+ preserveSandboxes?: TestSandboxRetentionMode;
56
+ runSuffix?: string | null;
57
+ }): Promise<SavedReadinessCheckOutcome | null>;
58
+ export declare function runReadinessChecksForExecutor(options: {
59
+ sourcePath: string;
60
+ preparationConfig: SourcePreparationConfig;
61
+ portableContextPath: string | null;
62
+ mode: TestRunMode;
63
+ executor?: MethodExecutor | null;
64
+ preserveSandboxes?: TestSandboxRetentionMode;
65
+ runSuffix?: string | null;
66
+ saveLatest?: boolean;
67
+ }): Promise<ReadinessCheckRunResult>;