@interf/compiler 0.7.3 → 0.9.1

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 (302) hide show
  1. package/README.md +123 -89
  2. package/TRADEMARKS.md +1 -1
  3. package/agent-skills/interf-actions/SKILL.md +71 -0
  4. package/agent-skills/interf-actions/references/cli.md +190 -0
  5. package/apps/compiler-ui/.next/server/app/index.html +1 -0
  6. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_buildManifest.js +11 -0
  7. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_clientMiddlewareManifest.js +1 -0
  8. package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_ssgManifest.js +1 -0
  9. package/apps/compiler-ui/.next/static/chunks/03~yq9q893hmn.js +1 -0
  10. package/apps/compiler-ui/.next/static/chunks/06z~l3kwb891e.js +1 -0
  11. package/apps/compiler-ui/.next/static/chunks/08g7lvje.te.u.js +1 -0
  12. package/apps/compiler-ui/.next/static/chunks/08m7vf5asqlsm.js +91 -0
  13. package/apps/compiler-ui/.next/static/chunks/0_i-3_5l9t2qe.js +1 -0
  14. package/apps/compiler-ui/.next/static/chunks/0b-ywny_j0g~0.js +1 -0
  15. package/apps/compiler-ui/.next/static/chunks/0b52v41o1gixx.js +1 -0
  16. package/apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js +124 -0
  17. package/apps/compiler-ui/.next/static/chunks/0gpzgsv0w.q~m.js +31 -0
  18. package/apps/compiler-ui/.next/static/chunks/0ilwfezfvu6~-.js +1 -0
  19. package/apps/compiler-ui/.next/static/chunks/0n51hrfoufc7g.js +1 -0
  20. package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +5 -0
  21. package/apps/compiler-ui/.next/static/chunks/0xxmf45eskdt~.css +1 -0
  22. package/apps/compiler-ui/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
  23. package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +3 -0
  24. package/apps/compiler-ui/.next/static/chunks/14wtz~vq25~qq.js +1 -0
  25. package/apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js +1 -0
  26. package/apps/compiler-ui/.next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
  27. package/apps/compiler-ui/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
  28. package/apps/compiler-ui/.next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  29. package/apps/compiler-ui/.next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  30. package/apps/compiler-ui/.next/static/media/worker.102zas1s52_pf.js +109 -0
  31. package/builtin-workflows/interf/README.md +8 -8
  32. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
  33. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
  34. package/builtin-workflows/interf/improve/SKILL.md +1 -1
  35. package/builtin-workflows/interf/use/query/SKILL.md +1 -1
  36. package/builtin-workflows/interf/workflow.json +8 -8
  37. package/builtin-workflows/interf/workflow.schema.json +1 -1
  38. package/dist/cli/commands/check-draft.d.ts +5 -4
  39. package/dist/cli/commands/check-draft.js +18 -17
  40. package/dist/cli/commands/compile-controller.d.ts +3 -0
  41. package/dist/cli/commands/compile-controller.js +53 -45
  42. package/dist/cli/commands/compile.js +83 -27
  43. package/dist/cli/commands/compiled-flow.d.ts +3 -0
  44. package/dist/cli/commands/compiled-flow.js +9 -7
  45. package/dist/cli/commands/control-path.d.ts +11 -0
  46. package/dist/cli/commands/control-path.js +72 -0
  47. package/dist/cli/commands/create-workflow-wizard.d.ts +6 -0
  48. package/dist/cli/commands/create-workflow-wizard.js +191 -77
  49. package/dist/cli/commands/create.js +54 -40
  50. package/dist/cli/commands/default.js +4 -3
  51. package/dist/cli/commands/doctor.js +5 -5
  52. package/dist/cli/commands/executor-flow.js +1 -1
  53. package/dist/cli/commands/init.js +326 -76
  54. package/dist/cli/commands/list.js +8 -7
  55. package/dist/cli/commands/preparation-selection.d.ts +6 -0
  56. package/dist/cli/commands/preparation-selection.js +11 -0
  57. package/dist/cli/commands/reset.js +3 -3
  58. package/dist/cli/commands/source-config-wizard.d.ts +4 -3
  59. package/dist/cli/commands/source-config-wizard.js +175 -197
  60. package/dist/cli/commands/status.js +116 -8
  61. package/dist/cli/commands/test-flow.d.ts +1 -1
  62. package/dist/cli/commands/test-flow.js +31 -31
  63. package/dist/cli/commands/test.d.ts +4 -0
  64. package/dist/cli/commands/test.js +95 -58
  65. package/dist/cli/commands/verify.js +7 -7
  66. package/dist/cli/commands/web.d.ts +11 -0
  67. package/dist/cli/commands/web.js +373 -0
  68. package/dist/cli/index.d.ts +2 -1
  69. package/dist/cli/index.js +3 -1
  70. package/dist/index.d.ts +4 -2
  71. package/dist/index.js +3 -1
  72. package/dist/packages/agents/lib/execution.js +4 -2
  73. package/dist/packages/agents/lib/executors.d.ts +1 -0
  74. package/dist/packages/agents/lib/executors.js +1 -0
  75. package/dist/packages/agents/lib/render.d.ts +2 -2
  76. package/dist/packages/agents/lib/render.js +10 -9
  77. package/dist/packages/agents/lib/shells.d.ts +3 -11
  78. package/dist/packages/agents/lib/shells.js +45 -96
  79. package/dist/packages/agents/lib/types.d.ts +1 -0
  80. package/dist/packages/compiler/compiled-paths.d.ts +4 -1
  81. package/dist/packages/compiler/compiled-paths.js +7 -1
  82. package/dist/packages/compiler/compiled-pipeline.d.ts +7 -0
  83. package/dist/packages/compiler/compiled-pipeline.js +15 -4
  84. package/dist/packages/compiler/compiled-schema.js +1 -1
  85. package/dist/packages/compiler/compiled-stage-plan.d.ts +2 -2
  86. package/dist/packages/compiler/compiled-stage-plan.js +4 -4
  87. package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -0
  88. package/dist/packages/compiler/compiled-stage-runner.js +50 -2
  89. package/dist/packages/compiler/compiled-target.d.ts +1 -1
  90. package/dist/packages/compiler/compiled-target.js +2 -2
  91. package/dist/packages/compiler/lib/schema.d.ts +161 -1
  92. package/dist/packages/compiler/lib/schema.js +87 -1
  93. package/dist/packages/compiler/raw-snapshot.d.ts +9 -2
  94. package/dist/packages/compiler/runtime-acceptance.js +1 -1
  95. package/dist/packages/compiler/runtime-contracts.js +2 -2
  96. package/dist/packages/compiler/runtime-prompt.js +6 -6
  97. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  98. package/dist/packages/compiler/runtime-runs.js +3 -0
  99. package/dist/packages/compiler/runtime-types.d.ts +1 -0
  100. package/dist/packages/compiler/state-health.js +1 -1
  101. package/dist/packages/compiler/state-view.js +2 -2
  102. package/dist/packages/compiler/validate-compiled.js +11 -9
  103. package/dist/packages/execution/adapters.d.ts +15 -0
  104. package/dist/packages/execution/adapters.js +1 -0
  105. package/dist/packages/execution/events.d.ts +8 -0
  106. package/dist/packages/execution/events.js +16 -0
  107. package/dist/packages/execution/index.d.ts +9 -0
  108. package/dist/packages/execution/index.js +6 -0
  109. package/dist/packages/execution/lib/schema.d.ts +1554 -0
  110. package/dist/packages/execution/lib/schema.js +319 -0
  111. package/dist/packages/local-service/action-values.d.ts +23 -0
  112. package/dist/packages/local-service/action-values.js +31 -0
  113. package/dist/packages/local-service/client.d.ts +119 -0
  114. package/dist/packages/local-service/client.js +356 -0
  115. package/dist/packages/local-service/index.d.ts +15 -0
  116. package/dist/packages/local-service/index.js +11 -0
  117. package/dist/packages/local-service/lib/schema.d.ts +7355 -0
  118. package/dist/packages/local-service/lib/schema.js +636 -0
  119. package/dist/packages/local-service/routes.d.ts +27 -0
  120. package/dist/packages/local-service/routes.js +32 -0
  121. package/dist/packages/local-service/runtime.d.ts +134 -0
  122. package/dist/packages/local-service/runtime.js +2841 -0
  123. package/dist/packages/local-service/server.d.ts +17 -0
  124. package/dist/packages/local-service/server.js +572 -0
  125. package/dist/packages/project-model/index.d.ts +2 -1
  126. package/dist/packages/project-model/index.js +1 -0
  127. package/dist/packages/project-model/interf-detect.d.ts +6 -2
  128. package/dist/packages/project-model/interf-detect.js +25 -10
  129. package/dist/packages/project-model/interf-scaffold.js +9 -6
  130. package/dist/packages/project-model/interf.d.ts +1 -1
  131. package/dist/packages/project-model/interf.js +1 -1
  132. package/dist/packages/project-model/lib/schema.d.ts +80 -6
  133. package/dist/packages/project-model/lib/schema.js +29 -19
  134. package/dist/packages/project-model/source-config.d.ts +22 -13
  135. package/dist/packages/project-model/source-config.js +140 -123
  136. package/dist/packages/project-model/source-folders.d.ts +11 -0
  137. package/dist/packages/project-model/source-folders.js +110 -0
  138. package/dist/packages/testing/test-execution.js +5 -5
  139. package/dist/packages/testing/test-paths.js +1 -3
  140. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
  141. package/dist/packages/workflow-authoring/workflow-authoring.js +45 -86
  142. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
  143. package/dist/packages/workflow-authoring/workflow-edit-session.js +80 -49
  144. package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
  145. package/dist/packages/workflow-package/context-interface.js +1 -1
  146. package/dist/packages/workflow-package/interf-workflow-package.d.ts +6 -0
  147. package/dist/packages/workflow-package/interf-workflow-package.js +115 -8
  148. package/dist/packages/workflow-package/local-workflows.js +33 -17
  149. package/dist/packages/workflow-package/workflow-definitions.d.ts +5 -5
  150. package/dist/packages/workflow-package/workflow-definitions.js +23 -22
  151. package/dist/packages/workflow-package/workflow-helpers.js +10 -6
  152. package/dist/packages/workflow-package/workflow-stage-runner.d.ts +1 -0
  153. package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
  154. package/package.json +17 -1
  155. package/dist/cli/commands/dataset-selection.d.ts +0 -6
  156. package/dist/cli/commands/dataset-selection.js +0 -11
  157. package/dist/lib/agent-args.d.ts +0 -1
  158. package/dist/lib/agent-args.js +0 -1
  159. package/dist/lib/agent-constants.d.ts +0 -1
  160. package/dist/lib/agent-constants.js +0 -1
  161. package/dist/lib/agent-detection.d.ts +0 -1
  162. package/dist/lib/agent-detection.js +0 -1
  163. package/dist/lib/agent-execution.d.ts +0 -1
  164. package/dist/lib/agent-execution.js +0 -1
  165. package/dist/lib/agent-logs.d.ts +0 -1
  166. package/dist/lib/agent-logs.js +0 -1
  167. package/dist/lib/agent-preflight.d.ts +0 -1
  168. package/dist/lib/agent-preflight.js +0 -1
  169. package/dist/lib/agent-render.d.ts +0 -1
  170. package/dist/lib/agent-render.js +0 -1
  171. package/dist/lib/agent-shells.d.ts +0 -1
  172. package/dist/lib/agent-shells.js +0 -1
  173. package/dist/lib/agent-status.d.ts +0 -1
  174. package/dist/lib/agent-status.js +0 -1
  175. package/dist/lib/agent-types.d.ts +0 -1
  176. package/dist/lib/agent-types.js +0 -1
  177. package/dist/lib/agents.d.ts +0 -1
  178. package/dist/lib/agents.js +0 -1
  179. package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
  180. package/dist/lib/builtin-compiled-workflow.js +0 -1
  181. package/dist/lib/chart-guidance.d.ts +0 -1
  182. package/dist/lib/chart-guidance.js +0 -1
  183. package/dist/lib/compiled-compile.d.ts +0 -1
  184. package/dist/lib/compiled-compile.js +0 -1
  185. package/dist/lib/compiled-paths.d.ts +0 -1
  186. package/dist/lib/compiled-paths.js +0 -3
  187. package/dist/lib/compiled-raw.d.ts +0 -1
  188. package/dist/lib/compiled-raw.js +0 -3
  189. package/dist/lib/compiled-reset.d.ts +0 -1
  190. package/dist/lib/compiled-reset.js +0 -3
  191. package/dist/lib/compiled-schema.d.ts +0 -1
  192. package/dist/lib/compiled-schema.js +0 -1
  193. package/dist/lib/discovery.d.ts +0 -1
  194. package/dist/lib/discovery.js +0 -1
  195. package/dist/lib/execution-profile.d.ts +0 -1
  196. package/dist/lib/execution-profile.js +0 -1
  197. package/dist/lib/executors.d.ts +0 -1
  198. package/dist/lib/executors.js +0 -1
  199. package/dist/lib/filesystem.d.ts +0 -1
  200. package/dist/lib/filesystem.js +0 -1
  201. package/dist/lib/interf-bootstrap.d.ts +0 -1
  202. package/dist/lib/interf-bootstrap.js +0 -3
  203. package/dist/lib/interf-detect.d.ts +0 -1
  204. package/dist/lib/interf-detect.js +0 -3
  205. package/dist/lib/interf-scaffold.d.ts +0 -1
  206. package/dist/lib/interf-scaffold.js +0 -3
  207. package/dist/lib/interf-workflow-package.d.ts +0 -1
  208. package/dist/lib/interf-workflow-package.js +0 -1
  209. package/dist/lib/interf.d.ts +0 -1
  210. package/dist/lib/interf.js +0 -3
  211. package/dist/lib/local-workflows.d.ts +0 -1
  212. package/dist/lib/local-workflows.js +0 -1
  213. package/dist/lib/logger.d.ts +0 -1
  214. package/dist/lib/logger.js +0 -1
  215. package/dist/lib/package-root.d.ts +0 -1
  216. package/dist/lib/package-root.js +0 -1
  217. package/dist/lib/parse.d.ts +0 -1
  218. package/dist/lib/parse.js +0 -1
  219. package/dist/lib/project-paths.d.ts +0 -1
  220. package/dist/lib/project-paths.js +0 -3
  221. package/dist/lib/runtime-acceptance.d.ts +0 -1
  222. package/dist/lib/runtime-acceptance.js +0 -1
  223. package/dist/lib/runtime-contracts.d.ts +0 -1
  224. package/dist/lib/runtime-contracts.js +0 -1
  225. package/dist/lib/runtime-inventory.d.ts +0 -1
  226. package/dist/lib/runtime-inventory.js +0 -1
  227. package/dist/lib/runtime-paths.d.ts +0 -1
  228. package/dist/lib/runtime-paths.js +0 -1
  229. package/dist/lib/runtime-prompt.d.ts +0 -1
  230. package/dist/lib/runtime-prompt.js +0 -1
  231. package/dist/lib/runtime-reconcile.d.ts +0 -1
  232. package/dist/lib/runtime-reconcile.js +0 -1
  233. package/dist/lib/runtime-runs.d.ts +0 -1
  234. package/dist/lib/runtime-runs.js +0 -1
  235. package/dist/lib/runtime-types.d.ts +0 -1
  236. package/dist/lib/runtime-types.js +0 -1
  237. package/dist/lib/runtime.d.ts +0 -1
  238. package/dist/lib/runtime.js +0 -1
  239. package/dist/lib/schema.d.ts +0 -4
  240. package/dist/lib/schema.js +0 -6
  241. package/dist/lib/source-config.d.ts +0 -1
  242. package/dist/lib/source-config.js +0 -3
  243. package/dist/lib/state-artifacts.d.ts +0 -1
  244. package/dist/lib/state-artifacts.js +0 -1
  245. package/dist/lib/state-health.d.ts +0 -1
  246. package/dist/lib/state-health.js +0 -1
  247. package/dist/lib/state-io.d.ts +0 -1
  248. package/dist/lib/state-io.js +0 -1
  249. package/dist/lib/state-paths.d.ts +0 -1
  250. package/dist/lib/state-paths.js +0 -1
  251. package/dist/lib/state-view.d.ts +0 -1
  252. package/dist/lib/state-view.js +0 -1
  253. package/dist/lib/state.d.ts +0 -1
  254. package/dist/lib/state.js +0 -1
  255. package/dist/lib/test-execution.d.ts +0 -1
  256. package/dist/lib/test-execution.js +0 -3
  257. package/dist/lib/test-matrices.d.ts +0 -1
  258. package/dist/lib/test-matrices.js +0 -3
  259. package/dist/lib/test-paths.d.ts +0 -1
  260. package/dist/lib/test-paths.js +0 -3
  261. package/dist/lib/test-profile-presets.d.ts +0 -1
  262. package/dist/lib/test-profile-presets.js +0 -3
  263. package/dist/lib/test-sandbox.d.ts +0 -1
  264. package/dist/lib/test-sandbox.js +0 -3
  265. package/dist/lib/test-specs.d.ts +0 -1
  266. package/dist/lib/test-specs.js +0 -3
  267. package/dist/lib/test-targets.d.ts +0 -1
  268. package/dist/lib/test-targets.js +0 -3
  269. package/dist/lib/test-types.d.ts +0 -1
  270. package/dist/lib/test-types.js +0 -3
  271. package/dist/lib/test.d.ts +0 -1
  272. package/dist/lib/test.js +0 -3
  273. package/dist/lib/util.d.ts +0 -1
  274. package/dist/lib/util.js +0 -1
  275. package/dist/lib/validate-compiled.d.ts +0 -1
  276. package/dist/lib/validate-compiled.js +0 -1
  277. package/dist/lib/validate-helpers.d.ts +0 -1
  278. package/dist/lib/validate-helpers.js +0 -1
  279. package/dist/lib/validate.d.ts +0 -1
  280. package/dist/lib/validate.js +0 -1
  281. package/dist/lib/workflow-authoring.d.ts +0 -1
  282. package/dist/lib/workflow-authoring.js +0 -1
  283. package/dist/lib/workflow-definitions.d.ts +0 -1
  284. package/dist/lib/workflow-definitions.js +0 -1
  285. package/dist/lib/workflow-edit-session.d.ts +0 -1
  286. package/dist/lib/workflow-edit-session.js +0 -1
  287. package/dist/lib/workflow-edit-utils.d.ts +0 -1
  288. package/dist/lib/workflow-edit-utils.js +0 -1
  289. package/dist/lib/workflow-helpers.d.ts +0 -1
  290. package/dist/lib/workflow-helpers.js +0 -1
  291. package/dist/lib/workflow-improvement.d.ts +0 -1
  292. package/dist/lib/workflow-improvement.js +0 -1
  293. package/dist/lib/workflow-primitives.d.ts +0 -1
  294. package/dist/lib/workflow-primitives.js +0 -1
  295. package/dist/lib/workflow-review-paths.d.ts +0 -1
  296. package/dist/lib/workflow-review-paths.js +0 -1
  297. package/dist/lib/workflow-stage-policy.d.ts +0 -1
  298. package/dist/lib/workflow-stage-policy.js +0 -1
  299. package/dist/lib/workflow-stage-runner.d.ts +0 -1
  300. package/dist/lib/workflow-stage-runner.js +0 -1
  301. package/dist/lib/workflows.d.ts +0 -1
  302. package/dist/lib/workflows.js +0 -1
@@ -1,32 +1,35 @@
1
1
  import chalk from "chalk";
2
2
  import * as p from "@clack/prompts";
3
3
  import { detectInterf, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
4
- import { fingerprintTruthChecks, loadCompiledDatasetConfig, sourceDatasetConfigFromInterfConfig, } from "../../packages/project-model/source-config.js";
4
+ import { fingerprintReadinessChecks, loadCompiledDatasetConfig, sourceDatasetConfigFromInterfConfig, } from "../../packages/project-model/source-config.js";
5
5
  import { addExecutionProfileOptions, executionProfileFromArgv, } from "../../packages/agents/lib/execution-profile.js";
6
6
  import { chooseCompiledConfigToBuild, findBuiltCompiledPath, } from "./compiled-flow.js";
7
- import { resolveConfiguredDatasetSelection } from "./dataset-selection.js";
7
+ import { resolveConfiguredPreparationSelection } from "./preparation-selection.js";
8
8
  import { printAgentTestFailures, printAgentTestMatrix, printSavedTestComparisonState, readSavedTestComparison, runSavedRawTest, runSavedCompiledTest, saveTestComparisonRun, } from "./test-flow.js";
9
+ import { createCompiledTestTarget } from "../../packages/testing/test-targets.js";
9
10
  import { listRunAgentOptions, promptForTestAgents, resolveNamedLocalExecutor, resolveOrConfigureLocalExecutor, } from "./executor-flow.js";
11
+ import { submitTestRunToLocalService, waitForLocalTestRun, } from "../../packages/local-service/index.js";
12
+ import { resolveCommandControlPath } from "./control-path.js";
10
13
  export const testCommand = {
11
14
  command: "test",
12
- describe: "Compare source files and portable context on saved questions",
15
+ describe: "Run readiness checks against source files and Portable Context",
13
16
  builder: (yargs) => addExecutionProfileOptions(yargs)
14
- .option("dataset", {
17
+ .option("preparation", {
15
18
  type: "string",
16
- describe: "Dataset id to test when this project has more than one dataset",
19
+ describe: "Preparation id to check when this Source Folder has more than one Preparation",
17
20
  })
18
21
  .option("target", {
19
22
  choices: ["both", "raw", "compiled"],
20
- describe: "Test source files, portable context, or both. Default: both when portable context exists, otherwise source files.",
23
+ describe: "Check source files, Portable Context, or both. Default: both when Portable Context exists, otherwise source files.",
21
24
  })
22
25
  .option("keep-sandboxes", {
23
26
  type: "boolean",
24
27
  default: false,
25
- describe: "Keep every test sandbox for review instead of pruning successful ones",
28
+ describe: "Keep every readiness-check sandbox for review instead of pruning successful ones",
26
29
  })
27
30
  .option("agents", {
28
31
  type: "string",
29
- describe: "Comma-separated local agents to use for this test, or `all`. Example: --agents claude-code,codex",
32
+ describe: "Comma-separated local agents to use for readiness checks, or `all`. Example: --agents claude-code,codex",
30
33
  }),
31
34
  handler: async (argv) => {
32
35
  await runTestCommand(argv);
@@ -40,27 +43,39 @@ function readRequestedMode(argv) {
40
43
  const value = argv.target;
41
44
  return value === "raw" || value === "compiled" || value === "both" ? value : null;
42
45
  }
46
+ function reportTestCommandFailure(argv, message, hints = []) {
47
+ process.exitCode = 1;
48
+ console.log(chalk.red(` ${message}`));
49
+ for (const hint of hints) {
50
+ console.log(chalk.dim(` ${hint}`));
51
+ }
52
+ const onFailure = typeof argv.onFailure === "function"
53
+ ? argv.onFailure
54
+ : null;
55
+ void onFailure?.({ message, hints });
56
+ return false;
57
+ }
43
58
  async function promptTestMode(hasBuiltCompiled) {
44
59
  if (!hasBuiltCompiled) {
45
60
  return "raw";
46
61
  }
47
62
  const selected = await p.select({
48
- message: "What do you want to test?",
63
+ message: "What do you want to check?",
49
64
  options: [
50
65
  {
51
66
  value: "both",
52
- label: "Compare source files and portable context (Recommended)",
53
- hint: "Measure whether the portable context helps your agents on the saved questions",
67
+ label: "Source files and Portable Context (Recommended)",
68
+ hint: "Check whether the data is ready with and without Portable Context",
54
69
  },
55
70
  {
56
71
  value: "raw",
57
72
  label: "Source files only",
58
- hint: "Measure the current baseline on the dataset files",
73
+ hint: "Measure the current baseline on the Source Folder files",
59
74
  },
60
75
  {
61
76
  value: "compiled",
62
- label: "Portable context only",
63
- hint: "Measure the current portable context on the saved questions",
77
+ label: "Portable Context only",
78
+ hint: "Run the saved readiness checks against the current Portable Context",
64
79
  },
65
80
  ],
66
81
  });
@@ -126,23 +141,23 @@ async function resolveSelectedTestAgents(options) {
126
141
  return selected;
127
142
  }
128
143
  }
129
- const fallback = await resolveOrConfigureLocalExecutor({
144
+ const resolved = await resolveOrConfigureLocalExecutor({
130
145
  preflight: true,
131
146
  executionProfile: options.executionProfile,
132
147
  purpose: "test",
133
148
  });
134
- if (!fallback.executor) {
135
- if (fallback.cancelled)
149
+ if (!resolved.executor) {
150
+ if (resolved.cancelled)
136
151
  return null;
137
152
  process.exitCode = 1;
138
- console.log(chalk.red(fallback.error ?? "No local agent detected."));
153
+ console.log(chalk.red(resolved.error ?? "No local agent detected."));
139
154
  return null;
140
155
  }
141
156
  return [
142
157
  {
143
- name: fallback.executor.name,
144
- label: fallback.executor.displayName,
145
- executor: fallback.executor,
158
+ name: resolved.executor.name,
159
+ label: resolved.executor.displayName,
160
+ executor: resolved.executor,
146
161
  },
147
162
  ];
148
163
  }
@@ -178,60 +193,56 @@ export async function runTestCommand(argv = {}) {
178
193
  const detected = detectInterf(cwd);
179
194
  const sourcePath = typeof argv.sourcePath === "string" && argv.sourcePath.trim().length > 0
180
195
  ? argv.sourcePath.trim()
181
- : (detected ? resolveSourceControlPath(detected.path) : cwd);
182
- const requestedDatasetName = typeof argv.dataset === "string" && argv.dataset.trim().length > 0
183
- ? argv.dataset.trim()
196
+ : (detected ? resolveSourceControlPath(detected.path) : resolveCommandControlPath(cwd));
197
+ const requestedPreparation = argv.preparation;
198
+ const requestedDatasetName = typeof requestedPreparation === "string" && requestedPreparation.trim().length > 0
199
+ ? requestedPreparation.trim()
184
200
  : null;
185
201
  const hintedDatasetConfig = (argv.datasetConfig ?? null);
186
202
  const selectedCompiled = detected
187
203
  ? (() => {
188
204
  const targetName = requestedDatasetName ?? hintedDatasetConfig?.name ?? detected.config.name;
189
- return resolveConfiguredDatasetSelection({
205
+ return resolveConfiguredPreparationSelection({
190
206
  sourcePath,
191
- requestedDatasetName: targetName,
192
- hintedDatasetConfig,
207
+ requestedPreparationName: targetName,
208
+ hintedPreparationConfig: hintedDatasetConfig,
193
209
  }) ?? (targetName === detected.config.name
194
210
  ? (loadCompiledDatasetConfig(detected.path)
195
211
  ?? sourceDatasetConfigFromInterfConfig(detected.config))
196
212
  : null);
197
213
  })()
198
214
  : requestedDatasetName || hintedDatasetConfig
199
- ? resolveConfiguredDatasetSelection({
215
+ ? resolveConfiguredPreparationSelection({
200
216
  sourcePath,
201
- requestedDatasetName,
202
- hintedDatasetConfig,
217
+ requestedPreparationName: requestedDatasetName,
218
+ hintedPreparationConfig: hintedDatasetConfig,
203
219
  })
204
220
  : await chooseCompiledConfigToBuild({
205
221
  sourcePath,
206
- selectMessage: "Which source folder setup do you want to test?",
222
+ selectMessage: "Which saved Preparation do you want to test?",
207
223
  });
208
224
  if (selectedCompiled === undefined)
209
225
  return false;
210
226
  if (!selectedCompiled) {
211
- process.exitCode = 1;
212
227
  if (requestedDatasetName) {
213
- console.log(chalk.red(` Setup "${requestedDatasetName}" is not set up in this project.`));
214
- console.log(chalk.dim(" Run `interf list` to see the saved setups."));
215
- }
216
- else {
217
- console.log(chalk.red(" No saved setups are configured for this folder yet."));
218
- console.log(chalk.dim(" Start with `interf` or `interf init`."));
228
+ return reportTestCommandFailure(argv, `Preparation "${requestedDatasetName}" is not saved in this Source Folder.`, ["Run `interf list` to see the saved Preparations."]);
219
229
  }
220
- return false;
230
+ return reportTestCommandFailure(argv, "No saved Preparations are configured for this Source Folder yet.", ["Start with `interf` or `interf init`."]);
221
231
  }
222
232
  if (selectedCompiled.checks.length === 0) {
223
- process.exitCode = 1;
224
- console.log(chalk.red(` Setup "${selectedCompiled.name}" does not have any questions yet.`));
225
- console.log(chalk.dim(" Run `interf`, edit this setup, and add a few questions first."));
226
- console.log(chalk.dim(" Then rerun `interf test`."));
227
- return false;
233
+ return reportTestCommandFailure(argv, `Preparation "${selectedCompiled.name}" does not have any readiness checks yet.`, [
234
+ "Run `interf`, edit this Preparation, and add a few readiness checks first.",
235
+ "Then rerun `interf test`.",
236
+ ]);
228
237
  }
229
238
  const executionProfile = executionProfileFromArgv(argv);
230
239
  const preserveSandboxes = readSandboxRetentionMode(argv);
231
240
  const builtCompiledPath = detected?.config.name === selectedCompiled.name
232
241
  ? detected.path
233
242
  : findBuiltCompiledPath(sourcePath, selectedCompiled.name);
234
- const hasBuiltCompiled = Boolean(builtCompiledPath);
243
+ const hasBuiltCompiled = builtCompiledPath
244
+ ? createCompiledTestTarget(builtCompiledPath, selectedCompiled.name, selectedCompiled.method ?? selectedCompiled.workflow ?? "interf-default").eligible
245
+ : false;
235
246
  const requestedMode = readRequestedMode(argv);
236
247
  const selectedMode = requestedMode ?? (process.stdin.isTTY && process.stdout.isTTY
237
248
  ? await promptTestMode(hasBuiltCompiled)
@@ -239,18 +250,47 @@ export async function runTestCommand(argv = {}) {
239
250
  if (!selectedMode)
240
251
  return false;
241
252
  if (selectedMode === "compiled" && !hasBuiltCompiled) {
242
- process.exitCode = 1;
243
- console.log(chalk.red(` Setup "${selectedCompiled.name}" does not have portable context agents can use yet.`));
244
- console.log(chalk.dim(" Run `interf compile` first."));
245
- return false;
253
+ return reportTestCommandFailure(argv, `Preparation "${selectedCompiled.name}" does not have Portable Context agents can use yet.`, ["Run `interf compile` first."]);
246
254
  }
247
255
  if (selectedMode === "both" && !hasBuiltCompiled) {
248
- process.exitCode = 1;
249
- console.log(chalk.red(` Setup "${selectedCompiled.name}" does not have portable context agents can use yet, so Interf cannot compare source files and portable context.`));
250
- console.log(chalk.dim(" Run `interf compile` first, or rerun with `--target raw`."));
251
- return false;
256
+ return reportTestCommandFailure(argv, `Preparation "${selectedCompiled.name}" does not have Portable Context agents can use yet, so Interf cannot compare source files and Portable Context.`, ["Run `interf compile` first, or rerun with `--target raw`."]);
252
257
  }
253
258
  const mode = selectedMode;
259
+ if (argv.skipService !== true) {
260
+ const submitted = await submitTestRunToLocalService({
261
+ projectPath: sourcePath,
262
+ request: {
263
+ preparation: selectedCompiled.name,
264
+ mode,
265
+ },
266
+ });
267
+ if (submitted) {
268
+ console.log(chalk.dim(` Visible in Interf: ${submitted.serviceUrl}/`));
269
+ let lastStatus = "";
270
+ const completed = await waitForLocalTestRun({
271
+ serviceUrl: submitted.serviceUrl,
272
+ runId: submitted.resource.run_id,
273
+ onUpdate(resource) {
274
+ if (resource.status === lastStatus)
275
+ return;
276
+ lastStatus = resource.status;
277
+ console.log(chalk.dim(` Readiness check run: ${resource.status}`));
278
+ },
279
+ });
280
+ if (completed.status !== "succeeded") {
281
+ return reportTestCommandFailure(argv, `Readiness check run ${completed.status}.`, completed.error ? [completed.error] : []);
282
+ }
283
+ const compiledScore = completed.comparison?.compiled;
284
+ const rawScore = completed.comparison?.raw;
285
+ if (compiledScore) {
286
+ console.log(chalk.green(` Portable Context readiness checks: ${compiledScore.passed_cases}/${compiledScore.total_cases}`));
287
+ }
288
+ if (rawScore) {
289
+ console.log(chalk.dim(` Source files readiness checks: ${rawScore.passed_cases}/${rawScore.total_cases}`));
290
+ }
291
+ return true;
292
+ }
293
+ }
254
294
  const selectedAgents = await resolveSelectedTestAgents({
255
295
  argv,
256
296
  executionProfile,
@@ -267,10 +307,7 @@ export async function runTestCommand(argv = {}) {
267
307
  executor: agent.executor,
268
308
  })));
269
309
  if ((mode === "compiled" || mode === "both") && rows.some((row) => !row.compiledOutcome)) {
270
- process.exitCode = 1;
271
- console.log(chalk.red(` Setup "${selectedCompiled.name}" does not have portable context agents can use yet.`));
272
- console.log(chalk.dim(" Run `interf compile` first."));
273
- return false;
310
+ return reportTestCommandFailure(argv, `Preparation "${selectedCompiled.name}" does not have Portable Context agents can use yet.`, ["Run `interf compile` first."]);
274
311
  }
275
312
  printAgentTestMatrix(rows);
276
313
  printAgentTestFailures(rows);
@@ -290,7 +327,7 @@ export async function runTestCommand(argv = {}) {
290
327
  sourcePath,
291
328
  compiledPath: builtCompiledPath ?? null,
292
329
  compiledName: selectedCompiled.name,
293
- checksFingerprint: fingerprintTruthChecks(selectedCompiled.checks),
330
+ checksFingerprint: fingerprintReadinessChecks(selectedCompiled.checks),
294
331
  mode,
295
332
  rawOutcome: row?.rawOutcome ?? null,
296
333
  compiledOutcome: row?.compiledOutcome ?? null,
@@ -9,8 +9,8 @@ function normalizeVerifyCheck(value) {
9
9
  return "stage";
10
10
  if (value === "compiled" || value === "compile")
11
11
  return "compiled";
12
- if (value === "workflow")
13
- return "workflow";
12
+ if (value === "method")
13
+ return "method";
14
14
  return null;
15
15
  }
16
16
  export const verifyCommand = {
@@ -19,7 +19,7 @@ export const verifyCommand = {
19
19
  builder: (yargs) => yargs
20
20
  .positional("check", {
21
21
  type: "string",
22
- describe: "Check to run (`stage`, `compiled`, or `workflow`)",
22
+ describe: "Check to run (`stage`, `compiled`, or `method`)",
23
23
  })
24
24
  .positional("stageId", {
25
25
  type: "string",
@@ -27,7 +27,7 @@ export const verifyCommand = {
27
27
  })
28
28
  .option("path", {
29
29
  type: "string",
30
- describe: "Path to a workflow package when using `verify workflow`",
30
+ describe: "Path to a Method package when using `verify method`",
31
31
  })
32
32
  .option("json", {
33
33
  type: "boolean",
@@ -42,11 +42,11 @@ export const verifyCommand = {
42
42
  return;
43
43
  }
44
44
  let result;
45
- if (check === "workflow") {
45
+ if (check === "method") {
46
46
  const path = argv.path;
47
47
  if (!path) {
48
48
  process.exitCode = 1;
49
- console.log(chalk.red("`interf verify workflow` needs --path <workflow-dir>."));
49
+ console.log(chalk.red("`interf verify method` needs --path <method-dir>."));
50
50
  return;
51
51
  }
52
52
  result = validateWorkflowPackage(path);
@@ -55,7 +55,7 @@ export const verifyCommand = {
55
55
  const detected = detectInterf(process.cwd());
56
56
  if (!detected) {
57
57
  process.exitCode = 1;
58
- console.log(chalk.red("Run this from inside a compiled context."));
58
+ console.log(chalk.red("Run this from inside Portable Context."));
59
59
  return;
60
60
  }
61
61
  if (check === "compiled") {
@@ -0,0 +1,11 @@
1
+ import type { CommandModule } from "yargs";
2
+ export declare const webCommand: CommandModule;
3
+ export interface WebProjectPaths {
4
+ controlPath: string;
5
+ sourceFolderPath: string | null;
6
+ }
7
+ export declare function resolveWebProjectPaths(argv?: Record<string, unknown>, cwd?: string): WebProjectPaths;
8
+ export declare function ensureWebProjectInitialized(controlPath: string, options?: {
9
+ sourceFolderPath?: string | null;
10
+ }): void;
11
+ export declare function runWebCommand(argv?: Record<string, unknown>): Promise<void>;