@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
@@ -4,11 +4,11 @@ import { slugify } from "../../packages/shared/naming.js";
4
4
  import { submitReadinessCheckDraftToLocalService, } from "../../packages/local-service/index.js";
5
5
  import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
6
6
  import { draftReadinessChecks } from "./check-draft.js";
7
- export const DEFAULT_COMPILED_NAME = "dataset1";
7
+ export const DEFAULT_PREPARATION_NAME = "default";
8
8
  export const DEFAULT_COMPILED_CHECK_QUESTION_PLACEHOLDER = "An agent-work-critical check you can already verify from this Source Folder";
9
9
  export const DEFAULT_COMPILED_CHECK_ANSWER_PLACEHOLDER = "The expected answer in plain English";
10
10
  export const DEFAULT_COMPILED_ABOUT_PLACEHOLDER = "Example: board prep from these files, chart reads from this report, or tax review from these exports.";
11
- export const DEFAULT_DATASET_PATH_PLACEHOLDER = "./dataset1";
11
+ export const DEFAULT_SOURCE_FOLDER_PATH_PLACEHOLDER = "./source-files";
12
12
  export const DEFAULT_COMPILE_RETRY_ATTEMPTS = 3;
13
13
  export const DEFAULT_SELF_IMPROVING_LOOPS = 3;
14
14
  const DEFAULT_SELF_IMPROVING_ATTEMPTS = 1;
@@ -18,20 +18,20 @@ function normalizeOptionalPromptText(value) {
18
18
  const normalized = value.trim();
19
19
  return normalized.length > 0 ? normalized : undefined;
20
20
  }
21
- export function normalizeDatasetPathForConfig(projectPath, value) {
22
- return projectSourceFolders.normalizeSourceDatasetPathForConfig(projectPath, value);
21
+ export function normalizeSourceFolderPathForConfig(projectPath, value) {
22
+ return projectSourceFolders.normalizeSourcePreparationPathForConfig(projectPath, value);
23
23
  }
24
- function defaultDatasetNameForPath(datasetPath) {
25
- return projectSourceFolders.defaultDatasetNameForPath(datasetPath);
24
+ function defaultPreparationNameForPath(sourceFolderPath) {
25
+ return projectSourceFolders.defaultPreparationNameForPath(sourceFolderPath);
26
26
  }
27
- export function listDatasetFolderChoices(cwd = process.cwd()) {
27
+ export function listSourceFolderChoices(cwd = process.cwd()) {
28
28
  return projectSourceFolders.listSourceFolderChoices(cwd);
29
29
  }
30
- export function defaultDatasetPathForPrompt(name, introStyle, cwd = process.cwd()) {
31
- return projectSourceFolders.defaultSourceDatasetPathForPrompt(name, introStyle, cwd);
30
+ export function defaultSourceFolderPathForPrompt(name, introStyle, cwd = process.cwd()) {
31
+ return projectSourceFolders.defaultSourcePreparationPathForPrompt(name, introStyle, cwd);
32
32
  }
33
- async function promptDatasetFolderPath(options) {
34
- const folderChoices = listDatasetFolderChoices(options.projectPath);
33
+ async function promptSourceFolderPath(options) {
34
+ const folderChoices = listSourceFolderChoices(options.projectPath);
35
35
  if (folderChoices.length > 0) {
36
36
  const selected = await p.select({
37
37
  message: "Which Source Folder should Interf use?",
@@ -51,7 +51,7 @@ async function promptDatasetFolderPath(options) {
51
51
  return null;
52
52
  if (selected !== "__manual__") {
53
53
  try {
54
- return normalizeDatasetPathForConfig(options.projectPath, String(selected));
54
+ return normalizeSourceFolderPathForConfig(options.projectPath, String(selected));
55
55
  }
56
56
  catch (error) {
57
57
  p.log.error(error instanceof Error ? error.message : String(error));
@@ -59,16 +59,16 @@ async function promptDatasetFolderPath(options) {
59
59
  }
60
60
  }
61
61
  }
62
- const datasetPath = await p.text({
62
+ const sourceFolderPath = await p.text({
63
63
  message: "Which Source Folder should Interf use?",
64
- placeholder: DEFAULT_DATASET_PATH_PLACEHOLDER,
64
+ placeholder: DEFAULT_SOURCE_FOLDER_PATH_PLACEHOLDER,
65
65
  initialValue: options.initialPath,
66
66
  validate: (value) => {
67
67
  const normalized = value.trim();
68
68
  if (normalized.length === 0)
69
69
  return "Source Folder is required";
70
70
  try {
71
- normalizeDatasetPathForConfig(options.projectPath, normalized);
71
+ normalizeSourceFolderPathForConfig(options.projectPath, normalized);
72
72
  return undefined;
73
73
  }
74
74
  catch (error) {
@@ -76,11 +76,11 @@ async function promptDatasetFolderPath(options) {
76
76
  }
77
77
  },
78
78
  });
79
- if (p.isCancel(datasetPath))
79
+ if (p.isCancel(sourceFolderPath))
80
80
  return null;
81
- return normalizeDatasetPathForConfig(options.projectPath, String(datasetPath));
81
+ return normalizeSourceFolderPathForConfig(options.projectPath, String(sourceFolderPath));
82
82
  }
83
- export function datasetAboutPromptMessage(introStyle) {
83
+ export function preparationAboutPromptMessage(introStyle) {
84
84
  if (introStyle === "edit") {
85
85
  return "What agent work should this Preparation stay focused on?";
86
86
  }
@@ -173,12 +173,12 @@ function printDraftReadinessChecks(checks) {
173
173
  }
174
174
  }
175
175
  async function promptDraftReadinessChecks(options) {
176
- let resolvedDatasetPath;
176
+ let resolvedSourceFolderPath;
177
177
  try {
178
- const datasetConfig = {
179
- path: options.datasetPath,
178
+ const preparationPathConfig = {
179
+ path: options.sourceFolderPath,
180
180
  };
181
- resolvedDatasetPath = projectSourceConfig.resolveSourceDatasetPath(options.projectPath, datasetConfig);
181
+ resolvedSourceFolderPath = projectSourceConfig.resolveSourcePreparationPath(options.projectPath, preparationPathConfig);
182
182
  }
183
183
  catch (error) {
184
184
  p.log.error(error instanceof Error ? error.message : String(error));
@@ -190,8 +190,8 @@ async function promptDraftReadinessChecks(options) {
190
190
  const serviceRun = await submitReadinessCheckDraftToLocalService({
191
191
  projectPath: options.projectPath,
192
192
  request: {
193
- preparation: options.datasetName,
194
- source_folder_path: resolvedDatasetPath,
193
+ preparation: options.preparationName,
194
+ source_folder_path: resolvedSourceFolderPath,
195
195
  about: options.about,
196
196
  target_count: 4,
197
197
  },
@@ -247,8 +247,8 @@ async function promptDraftReadinessChecks(options) {
247
247
  : "skip";
248
248
  }
249
249
  return draftReadinessChecks({
250
- datasetName: options.datasetName,
251
- datasetPath: resolvedDatasetPath,
250
+ preparationName: options.preparationName,
251
+ sourceFolderPath: resolvedSourceFolderPath,
252
252
  about: options.about,
253
253
  executor: resolved.executor,
254
254
  targetCount: 4,
@@ -358,8 +358,8 @@ async function promptCompiledChecks(options) {
358
358
  if (mode === "draft") {
359
359
  const drafted = await promptDraftReadinessChecks({
360
360
  projectPath: options.projectPath,
361
- datasetName: options.datasetName,
362
- datasetPath: options.datasetPath,
361
+ preparationName: options.preparationName,
362
+ sourceFolderPath: options.sourceFolderPath,
363
363
  about: options.initialAbout,
364
364
  });
365
365
  if (drafted === null)
@@ -430,8 +430,8 @@ async function promptCompiledChecks(options) {
430
430
  if (mode === "redraft") {
431
431
  const drafted = await promptDraftReadinessChecks({
432
432
  projectPath: options.projectPath,
433
- datasetName: options.datasetName,
434
- datasetPath: options.datasetPath,
433
+ preparationName: options.preparationName,
434
+ sourceFolderPath: options.sourceFolderPath,
435
435
  about: options.initialAbout,
436
436
  });
437
437
  if (drafted === null)
@@ -589,29 +589,29 @@ export async function promptSingleCompiledConfig(options = {}) {
589
589
  }
590
590
  let about = normalizeOptionalPromptText(initial?.about);
591
591
  const projectPath = options.projectPath ?? process.cwd();
592
- const defaultNameSeed = slugify(String(initial?.name ?? DEFAULT_COMPILED_NAME)) || DEFAULT_COMPILED_NAME;
593
- const defaultDatasetPath = initial?.path ?? defaultDatasetPathForPrompt(defaultNameSeed, introStyle, projectPath);
594
- const normalizedDatasetPath = options.fixedPath
592
+ const defaultNameSeed = slugify(String(initial?.name ?? DEFAULT_PREPARATION_NAME)) || DEFAULT_PREPARATION_NAME;
593
+ const defaultSourceFolderPath = initial?.path ?? defaultSourceFolderPathForPrompt(defaultNameSeed, introStyle, projectPath);
594
+ const normalizedSourceFolderPath = options.fixedPath
595
595
  ? (() => {
596
596
  try {
597
- return normalizeDatasetPathForConfig(projectPath, options.fixedPath);
597
+ return normalizeSourceFolderPathForConfig(projectPath, options.fixedPath);
598
598
  }
599
599
  catch (error) {
600
600
  p.log.error(error instanceof Error ? error.message : String(error));
601
601
  return null;
602
602
  }
603
603
  })()
604
- : await promptDatasetFolderPath({
604
+ : await promptSourceFolderPath({
605
605
  projectPath,
606
- initialPath: defaultDatasetPath,
606
+ initialPath: defaultSourceFolderPath,
607
607
  });
608
- if (!normalizedDatasetPath)
608
+ if (!normalizedSourceFolderPath)
609
609
  return null;
610
610
  if (options.fixedPath) {
611
- p.log.info(`Source Folder: ${normalizedDatasetPath}`);
611
+ p.log.info(`Source Folder: ${normalizedSourceFolderPath}`);
612
612
  }
613
613
  if (!name) {
614
- const suggestedName = defaultDatasetNameForPath(normalizedDatasetPath);
614
+ const suggestedName = defaultPreparationNameForPath(normalizedSourceFolderPath);
615
615
  const rawName = await p.text({
616
616
  message: "Preparation name?",
617
617
  placeholder: suggestedName,
@@ -635,7 +635,7 @@ export async function promptSingleCompiledConfig(options = {}) {
635
635
  };
636
636
  if (!(options.skipAboutPrompt && initial?.about)) {
637
637
  const aboutInput = await p.text({
638
- message: datasetAboutPromptMessage(introStyle),
638
+ message: preparationAboutPromptMessage(introStyle),
639
639
  placeholder: DEFAULT_COMPILED_ABOUT_PLACEHOLDER,
640
640
  initialValue: about ?? "",
641
641
  });
@@ -645,8 +645,8 @@ export async function promptSingleCompiledConfig(options = {}) {
645
645
  }
646
646
  const checks = await promptCompiledChecks({
647
647
  projectPath: options.projectPath ?? process.cwd(),
648
- datasetName: name,
649
- datasetPath: normalizedDatasetPath,
648
+ preparationName: name,
649
+ sourceFolderPath: normalizedSourceFolderPath,
650
650
  initialAbout: about,
651
651
  initialChecks: initial?.checks,
652
652
  });
@@ -667,7 +667,7 @@ export async function promptSingleCompiledConfig(options = {}) {
667
667
  }
668
668
  return {
669
669
  name,
670
- path: normalizedDatasetPath,
670
+ path: normalizedSourceFolderPath,
671
671
  ...(about ? { about } : {}),
672
672
  ...(typeof compileLoopSelection.max_attempts === "number"
673
673
  ? { max_attempts: compileLoopSelection.max_attempts }
@@ -1,8 +1,8 @@
1
1
  import chalk from "chalk";
2
2
  import * as p from "@clack/prompts";
3
- import { detectInterf, listCompiledDatasetsForSourceFolder, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
3
+ import { detectInterf, listPortableContextsForSourceFolder, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
4
4
  import { computeCompiledHealth } from "../../packages/compiler/state.js";
5
- import { sourceDatasetConfigFromInterfConfig, loadCompiledDatasetConfig, } from "../../packages/project-model/source-config.js";
5
+ import { sourcePreparationConfigFromInterfConfig, loadCompiledPreparationConfig, } from "../../packages/project-model/source-config.js";
6
6
  import { printSavedTestComparisonState, readCurrentSavedTestComparison } from "./test-flow.js";
7
7
  import { findLocalService, readLocalServiceRunSnapshot, } from "../../packages/local-service/index.js";
8
8
  import { resolveCommandControlPath } from "./control-path.js";
@@ -18,6 +18,33 @@ function statusColor(status) {
18
18
  return chalk.dim;
19
19
  }
20
20
  }
21
+ function publicReadinessStatus(status) {
22
+ return status === "compiled" ? "ready" : "not ready";
23
+ }
24
+ function publicPrepareState(status) {
25
+ if (status === "compiled")
26
+ return "prepared";
27
+ if (status === "idle")
28
+ return "not prepared";
29
+ return status;
30
+ }
31
+ function publicHealthSummary(health) {
32
+ const completedStages = health.metrics.completed_stages;
33
+ const stageTotal = health.metrics.stage_total;
34
+ if (typeof completedStages === "number" && typeof stageTotal === "number") {
35
+ if (health.status === "compiled") {
36
+ return `Portable Context ready — ${completedStages}/${stageTotal} Method stages satisfied.`;
37
+ }
38
+ if (health.status === "stale") {
39
+ return `Portable Context not ready — ${completedStages}/${stageTotal} Method stages satisfied.`;
40
+ }
41
+ }
42
+ return health.summary
43
+ .replace(/\bCompiled\b/g, "Prepared")
44
+ .replace(/\bcompiled\b/g, "prepared")
45
+ .replace(/\bmethod stages\b/g, "Method stages")
46
+ .replace(/\bmethod stage\b/g, "Method stage");
47
+ }
21
48
  export const statusCommand = {
22
49
  command: "status",
23
50
  describe: "Show deterministic health for the Portable Context agents use",
@@ -46,7 +73,7 @@ export const statusCommand = {
46
73
  }
47
74
  else {
48
75
  const sourcePath = resolveCommandControlPath();
49
- const local = listCompiledDatasetsForSourceFolder(sourcePath).map(({ path, config }) => ({
76
+ const local = listPortableContextsForSourceFolder(sourcePath).map(({ path, config }) => ({
50
77
  path,
51
78
  name: config.name,
52
79
  }));
@@ -73,17 +100,17 @@ export const statusCommand = {
73
100
  const color = statusColor(health.status);
74
101
  console.log();
75
102
  console.log(color(` ${health.target_name}`));
76
- console.log(chalk.dim(` status: ${health.status}`));
77
- console.log(chalk.dim(` stage: ${health.stage}`));
78
- console.log(chalk.dim(` ${health.summary}`));
103
+ console.log(chalk.dim(` readiness: ${publicReadinessStatus(health.status)}`));
104
+ console.log(chalk.dim(` prepare state: ${publicPrepareState(health.status)}`));
105
+ console.log(chalk.dim(` ${publicHealthSummary(health)}`));
79
106
  const compiledConfig = readInterfConfig(compiledPath);
80
107
  const sourcePath = resolveSourceControlPath(compiledPath);
81
108
  const latestComparisonState = compiledConfig
82
109
  ? readCurrentSavedTestComparison({
83
110
  projectPath: sourcePath,
84
- datasetName: compiledConfig.name,
85
- checks: (loadCompiledDatasetConfig(compiledPath)
86
- ?? sourceDatasetConfigFromInterfConfig(compiledConfig)).checks,
111
+ preparationName: compiledConfig.name,
112
+ checks: (loadCompiledPreparationConfig(compiledPath)
113
+ ?? sourcePreparationConfigFromInterfConfig(compiledConfig)).checks,
87
114
  })
88
115
  : { comparison: null, stale: false };
89
116
  const latestComparison = latestComparisonState.comparison;
@@ -1,8 +1,8 @@
1
- import { type TestTargetCandidate, type TestTargetResult } from "../../packages/testing/test.js";
2
- import type { WorkflowExecutionProfile, WorkflowExecutor } from "../../packages/agents/lib/executors.js";
1
+ import type { TestTargetCandidate, TestTargetResult } from "../../packages/testing/test.js";
2
+ import type { MethodExecutionProfile, MethodExecutor } from "../../packages/agents/lib/executors.js";
3
3
  import type { TestSandboxRetentionMode } from "../../packages/testing/test-sandbox.js";
4
- import type { SourceDatasetConfig } from "../../packages/project-model/lib/schema.js";
5
- import type { TestRunComparison, TestRunMode } from "../../packages/testing/lib/schema.js";
4
+ import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
5
+ import type { ReadinessCheckRun, TestRunMode } from "../../packages/testing/lib/schema.js";
6
6
  export interface SavedTestOutcome {
7
7
  runPath: string;
8
8
  displayRunPath?: string;
@@ -15,16 +15,16 @@ export interface AgentTestMatrixRow {
15
15
  compiledOutcome?: SavedTestOutcome | null;
16
16
  }
17
17
  export declare function readinessPassRate(outcome: SavedTestOutcome): number;
18
- export declare function readSavedTestComparison(projectPath: string, datasetName: string): TestRunComparison | null;
18
+ export declare function readSavedTestComparison(projectPath: string, preparationName: string): ReadinessCheckRun | null;
19
19
  export declare function readCurrentSavedTestComparison(options: {
20
20
  projectPath: string;
21
- datasetName: string;
22
- checks: SourceDatasetConfig["checks"];
21
+ preparationName: string;
22
+ checks: SourcePreparationConfig["checks"];
23
23
  }): {
24
- comparison: TestRunComparison | null;
24
+ comparison: ReadinessCheckRun | null;
25
25
  stale: boolean;
26
26
  };
27
- export declare function printSavedTestComparisonState(payload: TestRunComparison, comparisonRunPath?: string | null): void;
27
+ export declare function printSavedTestComparisonState(payload: ReadinessCheckRun, comparisonRunPath?: string | null): void;
28
28
  export declare function printAgentTestMatrix(rows: AgentTestMatrixRow[]): void;
29
29
  export declare function printAgentTestFailures(rows: AgentTestMatrixRow[]): void;
30
30
  export declare function printSavedTestOutcome(prefix: string, outcome: SavedTestOutcome): void;
@@ -41,17 +41,17 @@ export declare function saveTestComparisonRun(options: {
41
41
  }): string;
42
42
  export declare function runSavedRawTest(options: {
43
43
  sourcePath: string;
44
- datasetConfig: SourceDatasetConfig;
45
- executor?: WorkflowExecutor | null;
46
- executionProfile?: WorkflowExecutionProfile;
44
+ preparationConfig: SourcePreparationConfig;
45
+ executor?: MethodExecutor | null;
46
+ executionProfile?: MethodExecutionProfile;
47
47
  preserveSandboxes?: TestSandboxRetentionMode;
48
48
  runSuffix?: string | null;
49
49
  }): Promise<SavedTestOutcome | null>;
50
50
  export declare function runSavedCompiledTest(options: {
51
51
  sourcePath: string;
52
- datasetConfig: SourceDatasetConfig;
53
- executor?: WorkflowExecutor | null;
54
- executionProfile?: WorkflowExecutionProfile;
52
+ preparationConfig: SourcePreparationConfig;
53
+ executor?: MethodExecutor | null;
54
+ executionProfile?: MethodExecutionProfile;
55
55
  compiledPath?: string | null;
56
56
  preserveSandboxes?: TestSandboxRetentionMode;
57
57
  runSuffix?: string | null;
@@ -1,87 +1,24 @@
1
1
  import chalk from "chalk";
2
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { dirname, join } from "node:path";
4
- import { createRawTestTarget, createCompiledTestTarget, runTargetTestsAuto, saveTargetTestRun, } from "../../packages/testing/test.js";
5
- import { buildTestSpecFromSourceFolderConfig, buildTestSpecFromCompiledDatasetConfig, fingerprintReadinessChecks, resolveSourceDatasetPath, } from "../../packages/project-model/source-config.js";
6
- import { ensurePortableContextScaffold, } from "../../packages/project-model/interf.js";
7
- import { datasetLatestTestStatePath, datasetLatestTestSummaryPath, normalizeDatasetTestRunId, datasetTestRunPath, datasetTestRunsRoot, } from "../../packages/project-model/project-paths.js";
8
- import { testRootForCompiled } from "../../packages/project-model/compiled-paths.js";
9
- import { readJsonFileWithSchema } from "../../packages/shared/parse.js";
10
- import { TestRunComparisonSchema } from "../../packages/testing/lib/schema.js";
11
- import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
2
+ import { readinessPassRate as readinessPassRateForOutcome, readCurrentSavedReadinessCheckRun, readSavedReadinessCheckRun, runSavedPortableContextCheck, runSavedSourceFilesCheck, saveReadinessCheckRun, } from "../../packages/testing/readiness-check-run.js";
12
3
  import { findBuiltCompiledPath } from "./compiled-flow.js";
13
4
  export function readinessPassRate(outcome) {
14
- return outcome.result.totalCases > 0
15
- ? Math.round((outcome.result.passedCases / outcome.result.totalCases) * 100)
16
- : 0;
5
+ return readinessPassRateForOutcome(outcome);
17
6
  }
18
7
  function visibleRunPath(outcome) {
19
8
  return outcome.displayRunPath ?? outcome.runPath;
20
9
  }
21
- function summarizeSavedTestOutcome(label, outcome) {
22
- return {
23
- label,
24
- run_path: visibleRunPath(outcome),
25
- ok: outcome.result.ok,
26
- passed_cases: outcome.result.passedCases,
27
- total_cases: outcome.result.totalCases,
28
- passed_checks: outcome.result.passedChecks,
29
- total_checks: outcome.result.totalChecks,
30
- target: outcome.target,
31
- };
10
+ function loadLatestComparison(projectPath, preparationName) {
11
+ return readSavedReadinessCheckRun(projectPath, preparationName);
32
12
  }
33
- function writeDatasetTargetRun(options) {
34
- const dirPath = datasetTestRunsRoot(options.projectPath, options.datasetName, options.target);
35
- mkdirSync(dirPath, { recursive: true });
36
- const runPath = datasetTestRunPath(options.projectPath, options.datasetName, options.target, options.generatedAt, options.runId, options.runSuffix);
37
- writeFileSync(runPath, `${JSON.stringify(options.payload, null, 2)}\n`);
38
- return runPath;
39
- }
40
- function loadLatestComparison(projectPath, datasetName) {
41
- const latestPath = datasetLatestTestStatePath(projectPath, datasetName);
42
- if (!existsSync(latestPath))
43
- return null;
44
- return readJsonFileWithSchema(latestPath, "latest test comparison", TestRunComparisonSchema);
45
- }
46
- export function readSavedTestComparison(projectPath, datasetName) {
47
- return loadLatestComparison(projectPath, datasetName);
13
+ export function readSavedTestComparison(projectPath, preparationName) {
14
+ return loadLatestComparison(projectPath, preparationName);
48
15
  }
49
16
  export function readCurrentSavedTestComparison(options) {
50
- const latestComparison = readSavedTestComparison(options.projectPath, options.datasetName);
51
- if (!latestComparison) {
52
- return { comparison: null, stale: false };
53
- }
54
- const currentFingerprint = fingerprintReadinessChecks(options.checks);
55
- if (!latestComparison.checks_fingerprint || latestComparison.checks_fingerprint !== currentFingerprint) {
56
- return { comparison: null, stale: true };
57
- }
58
- return { comparison: latestComparison, stale: false };
59
- }
60
- function renderLatestSummaryMarkdown(payload) {
61
- const lines = [
62
- "# Latest Readiness Results",
63
- "",
64
- "| Target | Readiness checks |",
65
- "| --- | --- |",
66
- ];
67
- if (payload.raw) {
68
- lines.push(`| Source files | \`${payload.raw.passed_cases}/${payload.raw.total_cases}\` |`);
69
- }
70
- if (payload.compiled) {
71
- lines.push(`| Portable Context | \`${payload.compiled.passed_cases}/${payload.compiled.total_cases}\` |`);
72
- }
73
- lines.push("");
74
- if (payload.summary.raw_pass_rate != null && payload.summary.compiled_pass_rate != null) {
75
- const direction = (payload.summary.pass_rate_delta ?? 0) >= 0 ? "improved" : "decreased";
76
- lines.push(`Readiness-check pass rate ${direction} from ${payload.summary.raw_pass_rate}% to ${payload.summary.compiled_pass_rate}%.`, "");
77
- }
78
- if (payload.raw) {
79
- lines.push(`- Latest source-files run: ${payload.raw.run_path}`);
80
- }
81
- if (payload.compiled) {
82
- lines.push(`- Latest portable-context run: ${payload.compiled.run_path}`);
83
- }
84
- return `${lines.join("\n")}\n`;
17
+ return readCurrentSavedReadinessCheckRun({
18
+ projectPath: options.projectPath,
19
+ preparationName: options.preparationName,
20
+ checks: options.checks,
21
+ });
85
22
  }
86
23
  export function printSavedTestComparisonState(payload, comparisonRunPath) {
87
24
  console.log();
@@ -184,22 +121,6 @@ export function printAgentTestFailures(rows) {
184
121
  }
185
122
  }
186
123
  }
187
- function specNeedsExecutor(spec) {
188
- return spec.cases.some((entry) => !entry.file || Boolean(entry.answer));
189
- }
190
- async function resolveExecutorForSpec(spec, executor, executionProfile) {
191
- if (!specNeedsExecutor(spec)) {
192
- return { executor: null, error: undefined };
193
- }
194
- if (executor) {
195
- return { executor, error: undefined };
196
- }
197
- return resolveOrConfigureLocalExecutor({
198
- preflight: true,
199
- executionProfile,
200
- purpose: "test",
201
- });
202
- }
203
124
  export function printSavedTestOutcome(prefix, outcome) {
204
125
  const color = outcome.result.ok ? chalk.green : chalk.red;
205
126
  const status = outcome.result.ok ? chalk.green("PASS") : chalk.red("FAIL");
@@ -278,144 +199,33 @@ export function printSavedTestComparisonSummary(rawOutcome, compiledOutcome, com
278
199
  }
279
200
  }
280
201
  export function saveTestComparisonRun(options) {
281
- const generatedAt = new Date().toISOString();
282
- const rawSummary = options.rawOutcome
283
- ? summarizeSavedTestOutcome("Source files", options.rawOutcome)
284
- : null;
285
- const compiledSummary = options.compiledOutcome
286
- ? summarizeSavedTestOutcome("Portable Context", options.compiledOutcome)
287
- : null;
288
- const effectiveMode = rawSummary && compiledSummary
289
- ? "both"
290
- : rawSummary
291
- ? "raw"
292
- : "compiled";
293
- const rawPassRate = rawSummary
294
- ? Math.round((rawSummary.passed_cases / rawSummary.total_cases) * 100)
295
- : null;
296
- const compiledPassRate = compiledSummary
297
- ? Math.round((compiledSummary.passed_cases / compiledSummary.total_cases) * 100)
298
- : null;
299
- const payload = {
300
- kind: "interf-test-run",
301
- version: 1,
302
- generated_at: generatedAt,
303
- mode: effectiveMode,
304
- source_path: options.sourcePath,
305
- checks_fingerprint: options.checksFingerprint,
306
- dataset: {
307
- name: options.compiledName,
308
- compiled_path: options.compiledPath,
309
- },
310
- raw: rawSummary,
311
- compiled: compiledSummary,
312
- summary: {
313
- raw_pass_rate: rawPassRate,
314
- compiled_pass_rate: compiledPassRate,
315
- pass_rate_delta: rawPassRate !== null && compiledPassRate !== null ? compiledPassRate - rawPassRate : null,
316
- },
317
- };
318
- const latestStatePath = datasetLatestTestStatePath(options.sourcePath, options.compiledName);
319
- mkdirSync(dirname(latestStatePath), { recursive: true });
320
- writeFileSync(latestStatePath, `${JSON.stringify(payload, null, 2)}\n`);
321
- writeFileSync(datasetLatestTestSummaryPath(options.sourcePath, options.compiledName), renderLatestSummaryMarkdown(payload));
322
- if (options.compiledPath) {
323
- mkdirSync(testRootForCompiled(options.compiledPath), { recursive: true });
324
- writeFileSync(join(testRootForCompiled(options.compiledPath), "latest.json"), `${JSON.stringify(payload, null, 2)}\n`);
325
- }
326
- return latestStatePath;
202
+ return saveReadinessCheckRun({
203
+ sourcePath: options.sourcePath,
204
+ portableContextPath: options.compiledPath,
205
+ preparationName: options.compiledName,
206
+ checksFingerprint: options.checksFingerprint,
207
+ mode: options.mode,
208
+ rawOutcome: options.rawOutcome,
209
+ compiledOutcome: options.compiledOutcome,
210
+ });
327
211
  }
328
212
  export async function runSavedRawTest(options) {
329
- const spec = buildTestSpecFromSourceFolderConfig({
213
+ return runSavedSourceFilesCheck({
330
214
  sourcePath: options.sourcePath,
331
- targetName: options.datasetConfig.name,
332
- targetType: "raw",
333
- });
334
- if (!spec) {
335
- return null;
336
- }
337
- const { executor, error } = await resolveExecutorForSpec(spec, options.executor, options.executionProfile);
338
- if (!executor && !error) {
339
- return null;
340
- }
341
- if (!executor && error) {
342
- process.exitCode = 1;
343
- console.log(chalk.red(error));
344
- return null;
345
- }
346
- const datasetSourcePath = resolveSourceDatasetPath(options.sourcePath, options.datasetConfig);
347
- const portableContextPath = ensurePortableContextScaffold(options.sourcePath, options.datasetConfig.name, options.datasetConfig.workflow ?? "interf");
348
- const target = createRawTestTarget(datasetSourcePath);
349
- const run = await runTargetTestsAuto(datasetSourcePath, spec, [target], {
350
- executor,
215
+ preparationConfig: options.preparationConfig,
216
+ executor: options.executor,
351
217
  preserveSandboxes: options.preserveSandboxes ?? "on-failure",
352
- artifactRootPath: testRootForCompiled(portableContextPath),
353
- });
354
- const result = run.results[0];
355
- if (!result)
356
- return null;
357
- const datasetRunPath = writeDatasetTargetRun({
358
- projectPath: options.sourcePath,
359
- datasetName: options.datasetConfig.name,
360
- target: "file-as-is",
361
- generatedAt: run.generated_at,
362
- runId: normalizeDatasetTestRunId(spec.id),
363
218
  runSuffix: options.runSuffix,
364
- payload: run,
365
219
  });
366
- return {
367
- runPath: datasetRunPath,
368
- target,
369
- result,
370
- };
371
220
  }
372
221
  export async function runSavedCompiledTest(options) {
373
- const compiledPath = options.compiledPath ?? findBuiltCompiledPath(options.sourcePath, options.datasetConfig.name);
374
- if (!compiledPath) {
375
- return null;
376
- }
377
- const spec = buildTestSpecFromCompiledDatasetConfig({
378
- compiledPath,
379
- targetType: "compiled",
380
- });
381
- if (!spec) {
382
- return null;
383
- }
384
- const target = createCompiledTestTarget(compiledPath, options.datasetConfig.name, options.datasetConfig.workflow ?? "interf");
385
- if (!target || !target.eligible) {
386
- return null;
387
- }
388
- const { executor, error } = await resolveExecutorForSpec(spec, options.executor, options.executionProfile);
389
- if (!executor && !error) {
390
- return null;
391
- }
392
- if (!executor && error) {
393
- process.exitCode = 1;
394
- console.log(chalk.red(error));
395
- return null;
396
- }
397
- const run = await runTargetTestsAuto(options.sourcePath, spec, [target], {
398
- executor,
222
+ const compiledPath = options.compiledPath ?? findBuiltCompiledPath(options.sourcePath, options.preparationConfig.name);
223
+ return runSavedPortableContextCheck({
224
+ sourcePath: options.sourcePath,
225
+ preparationConfig: options.preparationConfig,
226
+ executor: options.executor,
227
+ portableContextPath: compiledPath,
399
228
  preserveSandboxes: options.preserveSandboxes ?? "on-failure",
400
- artifactRootPath: compiledPath,
401
- });
402
- const result = run.results[0];
403
- if (!result)
404
- return null;
405
- const compiledRunPath = saveTargetTestRun(compiledPath, run);
406
- const datasetRunPath = writeDatasetTargetRun({
407
- projectPath: options.sourcePath,
408
- datasetName: options.datasetConfig.name,
409
- target: "compiled",
410
- generatedAt: run.generated_at,
411
- runId: normalizeDatasetTestRunId(spec.id),
412
229
  runSuffix: options.runSuffix,
413
- payload: run,
414
230
  });
415
- return {
416
- runPath: compiledRunPath,
417
- displayRunPath: datasetRunPath,
418
- target,
419
- result,
420
- };
421
231
  }
@@ -1,10 +1,10 @@
1
1
  import type { CommandModule } from "yargs";
2
- import type { SourceDatasetConfig } from "../../packages/project-model/lib/schema.js";
2
+ import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
3
3
  import { type AgentTestMatrixRow } from "./test-flow.js";
4
4
  type TestMode = "raw" | "compiled" | "both";
5
5
  export interface TestCommandResult {
6
6
  sourcePath: string;
7
- datasetConfig: SourceDatasetConfig;
7
+ preparationConfig: SourcePreparationConfig;
8
8
  builtCompiledPath: string | null;
9
9
  mode: TestMode;
10
10
  rows: AgentTestMatrixRow[];