@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
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
- import { COMPILED_ZONE_KINDS, } from "../workflow-primitives.js";
2
+ import { COMPILED_ZONE_KINDS, } from "../method-primitives.js";
3
+ import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
4
+ export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
3
5
  const JsonRecordSchema = z.record(z.string(), z.unknown());
4
6
  const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
5
7
  function isCompiledRelativePath(value) {
@@ -11,104 +13,10 @@ function isCompiledRelativePath(value) {
11
13
  .split(/[\\/]+/)
12
14
  .every((segment) => COMPILED_RELATIVE_PATH_SEGMENT.test(segment));
13
15
  }
14
- export const RuntimeTargetTypeSchema = z.enum(["compiled"]);
15
- export const TestTargetTypeSchema = z.enum(["compiled", "raw"]);
16
- export const WorkflowIdPattern = /^[a-z0-9][a-z0-9-]{0,79}$/;
17
- export const RuntimeStageSchema = z.string().regex(WorkflowIdPattern);
18
- export const RuntimeContractTypeSchema = z.string().regex(WorkflowIdPattern);
19
- export const WorkflowIdSchema = z.string().regex(WorkflowIdPattern);
20
- export const WorkflowZoneIdSchema = z.string().regex(WorkflowIdPattern);
21
- export const WorkflowCompiledZoneKindSchema = z.enum(COMPILED_ZONE_KINDS);
22
- export const WorkflowZoneRoleSchema = z.enum(["input", "working", "output", "runtime"]);
16
+ export const MethodZoneIdSchema = z.string().regex(InterfIdPattern);
17
+ export const MethodCompiledZoneKindSchema = z.enum(COMPILED_ZONE_KINDS);
18
+ export const MethodZoneRoleSchema = z.enum(["input", "working", "output", "runtime"]);
23
19
  export const CompiledStageStatusSchema = z.enum(["idle", "running", "succeeded", "failed"]);
24
- export const SourceCompiledMaxAttemptsSchema = z.number().int().min(1).max(5);
25
- export const SourceCompiledMaxLoopsSchema = z.number().int().min(1).max(3);
26
- export const ReadinessStatusSchema = z.enum([
27
- "not-configured",
28
- "not-built",
29
- "building",
30
- "built",
31
- "checking",
32
- "ready",
33
- "not-ready",
34
- "stale",
35
- "failed",
36
- ]);
37
- export const ReadinessGateSchema = z.enum([
38
- "preparation-config",
39
- "portable-context",
40
- "compile-run",
41
- "readiness-checks",
42
- "source-baseline",
43
- "portable-context-check",
44
- "checks-current",
45
- ]);
46
- export const ReadinessCheckSchema = z.object({
47
- gate: ReadinessGateSchema,
48
- ok: z.boolean(),
49
- status: ReadinessStatusSchema.optional(),
50
- summary: z.string().min(1),
51
- detail: z.string().min(1).optional(),
52
- run_id: z.string().min(1).nullable().optional(),
53
- artifact_path: z.string().min(1).nullable().optional(),
54
- }).strict();
55
- export const ReadinessTargetResultSchema = z.object({
56
- passed: z.number().int().min(0),
57
- total: z.number().int().min(0),
58
- pass_rate: z.number().min(0).max(100).nullable(),
59
- checks_fingerprint: z.string().min(1).nullable().optional(),
60
- stale: z.boolean().default(false),
61
- run_id: z.string().min(1).nullable().optional(),
62
- run_path: z.string().min(1).nullable().optional(),
63
- }).strict();
64
- function normalizeReadinessState(value) {
65
- if (!value || typeof value !== "object" || Array.isArray(value))
66
- return value;
67
- const input = value;
68
- const output = { ...input };
69
- if (typeof output.preparation !== "string" && typeof input.dataset === "string") {
70
- output.preparation = input.dataset;
71
- }
72
- delete output.dataset;
73
- if (Array.isArray(output.checks)) {
74
- output.checks = output.checks.map((check) => {
75
- if (!check || typeof check !== "object" || Array.isArray(check))
76
- return check;
77
- const normalizedCheck = { ...check };
78
- if (normalizedCheck.gate === "dataset-config")
79
- normalizedCheck.gate = "preparation-config";
80
- return normalizedCheck;
81
- });
82
- }
83
- if (output.compile && typeof output.compile === "object" && !Array.isArray(output.compile)) {
84
- const compile = { ...output.compile };
85
- if (compile.gate === "dataset-config")
86
- compile.gate = "preparation-config";
87
- output.compile = compile;
88
- }
89
- return output;
90
- }
91
- export const ReadinessStateSchema = z.preprocess(normalizeReadinessState, z.object({
92
- kind: z.literal("interf-readiness-state"),
93
- version: z.literal(1),
94
- generated_at: z.string().min(1),
95
- preparation: z.string().min(1),
96
- status: ReadinessStatusSchema,
97
- ready: z.boolean(),
98
- summary: z.string().min(1),
99
- portable_context_path: z.string().min(1).nullable(),
100
- latest_compile_run_id: z.string().min(1).nullable().optional(),
101
- latest_test_run_id: z.string().min(1).nullable().optional(),
102
- compile: ReadinessCheckSchema.nullable(),
103
- check_results: z.object({
104
- configured: z.number().int().min(0),
105
- fingerprint: z.string().min(1).nullable(),
106
- source_files: ReadinessTargetResultSchema.nullable(),
107
- portable_context: ReadinessTargetResultSchema.nullable(),
108
- delta: z.number().nullable(),
109
- }).strict(),
110
- checks: z.array(ReadinessCheckSchema).default([]),
111
- }).strict());
112
20
  export const CompiledStageStateSchema = z.object({
113
21
  contract_type: RuntimeContractTypeSchema.optional(),
114
22
  status: CompiledStageStatusSchema.optional(),
@@ -123,7 +31,7 @@ export const CompiledStageStateSchema = z.object({
123
31
  export const CompiledStateSchema = z.object({
124
32
  version: z.number().int().min(1),
125
33
  pending: z.array(z.string()),
126
- stages: z.record(z.string().regex(WorkflowIdPattern), CompiledStageStateSchema).optional(),
34
+ stages: z.record(z.string().regex(InterfIdPattern), CompiledStageStateSchema).optional(),
127
35
  last_add: z.string().nullable().optional(),
128
36
  last_compile: z.string().nullable().optional(),
129
37
  warning_count: z.number().optional(),
@@ -179,39 +87,39 @@ export const CompiledRawSnapshotSchema = z.object({
179
87
  source_total: z.number(),
180
88
  sample_files: z.array(z.string()),
181
89
  });
182
- export const WorkflowPurposeSchema = z.object({
90
+ export const MethodPurposeSchema = z.object({
183
91
  label: z.string().min(1),
184
92
  task_hint: z.string().min(1),
185
93
  }).strict();
186
- export const WorkflowZoneSchema = z.object({
187
- id: WorkflowZoneIdSchema,
188
- role: WorkflowZoneRoleSchema,
94
+ export const MethodZoneSchema = z.object({
95
+ id: MethodZoneIdSchema,
96
+ role: MethodZoneRoleSchema,
189
97
  path: z.string().min(1).refine(isCompiledRelativePath, {
190
98
  message: "Zone paths must stay inside the compiled root",
191
99
  }),
192
- kind: WorkflowCompiledZoneKindSchema,
100
+ kind: MethodCompiledZoneKindSchema,
193
101
  required: z.boolean(),
194
- owned_by: z.array(z.string().regex(WorkflowIdPattern)),
102
+ owned_by: z.array(z.string().regex(InterfIdPattern)),
195
103
  description: z.string().min(1),
196
104
  });
197
- export const WorkflowCompiledZoneSchema = WorkflowZoneSchema;
198
- // Persisted schema for the workflow-defined context interface that one
199
- // compiled context must implement on disk.
200
- export const WorkflowSchemaSchema = z.object({
201
- kind: z.literal("workflow-schema"),
105
+ export const MethodCompiledZoneSchema = MethodZoneSchema;
106
+ // Persisted schema for the method-defined context interface that one
107
+ // portable context must implement on disk.
108
+ export const MethodSchemaSchema = z.object({
109
+ kind: z.literal("method-schema"),
202
110
  version: z.literal(1),
203
111
  target_type: z.literal("compiled"),
204
112
  label: z.string().min(1),
205
- zones: z.array(WorkflowZoneSchema).min(1),
113
+ zones: z.array(MethodZoneSchema).min(1),
206
114
  });
207
- export const WorkflowCompiledSchemaSchema = WorkflowSchemaSchema;
208
- export const WorkflowCompilerApiSchema = z.object({
115
+ export const MethodCompiledSchemaSchema = MethodSchemaSchema;
116
+ export const MethodCompilerApiSchema = z.object({
209
117
  kind: z.literal("compiled"),
210
118
  version: z.literal(1),
211
119
  });
212
- export const WorkflowStageZoneAccessSchema = z.array(WorkflowZoneIdSchema).min(1);
120
+ export const MethodStageZoneAccessSchema = z.array(MethodZoneIdSchema).min(1);
213
121
  export const ExecutionShellZoneMountSchema = z.object({
214
- zone_id: WorkflowZoneIdSchema,
122
+ zone_id: MethodZoneIdSchema,
215
123
  compiled_path: z.string(),
216
124
  shell_root_path: z.string(),
217
125
  input_mount_path: z.string().nullable(),
@@ -220,23 +128,13 @@ export const ExecutionShellZoneMountSchema = z.object({
220
128
  export const ExecutionShellPathsSchema = z.object({
221
129
  kind: z.literal("interf-execution-shell"),
222
130
  version: z.literal(1),
223
- workflow: WorkflowIdSchema,
131
+ method: MethodIdSchema,
224
132
  stage: RuntimeStageSchema,
225
133
  reads: z.array(ExecutionShellZoneMountSchema),
226
134
  writes: z.array(ExecutionShellZoneMountSchema),
227
135
  });
228
- export const RuntimeExecutorInfoSchema = z.object({
229
- kind: z.enum(["local-agent", "connected-provider", "managed"]),
230
- name: z.string(),
231
- display_name: z.string(),
232
- command: z.string().nullable(),
233
- model: z.string().nullable().optional(),
234
- effort: z.string().nullable().optional(),
235
- profile: z.string().nullable().optional(),
236
- timeout_ms: z.number().nullable().optional(),
237
- });
238
136
  export const RuntimeStageInstructionsSchema = z.object({
239
- stage_skill_dir: z.string().regex(WorkflowIdPattern),
137
+ stage_skill_dir: z.string().regex(InterfIdPattern),
240
138
  effective_mode: z.enum(["builtin", "extend", "override"]),
241
139
  local_mode: z.enum(["extend", "override"]).nullable(),
242
140
  local_docs: z.array(z.string()),
@@ -248,12 +146,12 @@ export const RuntimeStageAcceptanceSchema = z.object({
248
146
  stage_equals_counts: z.record(z.string(), z.string()).optional(),
249
147
  stage_at_least: z.record(z.string(), z.number()).optional(),
250
148
  stage_at_least_counts: z.record(z.string(), z.string()).optional(),
251
- zone_counts_at_least: z.record(z.string().regex(WorkflowIdPattern), z.number()).optional(),
252
- zone_counts_at_least_counts: z.record(z.string().regex(WorkflowIdPattern), z.string()).optional(),
253
- markdown_frontmatter_valid_zones: z.array(WorkflowZoneIdSchema).optional(),
254
- frontmatter_required_keys_in_zones: z.record(WorkflowZoneIdSchema, z.array(z.string().min(1)).min(1)).optional(),
255
- markdown_abstract_valid_zones: z.array(WorkflowZoneIdSchema).optional(),
256
- wikilinks_valid_in_zones: z.array(WorkflowZoneIdSchema).optional(),
149
+ zone_counts_at_least: z.record(z.string().regex(InterfIdPattern), z.number()).optional(),
150
+ zone_counts_at_least_counts: z.record(z.string().regex(InterfIdPattern), z.string()).optional(),
151
+ markdown_frontmatter_valid_zones: z.array(MethodZoneIdSchema).optional(),
152
+ frontmatter_required_keys_in_zones: z.record(MethodZoneIdSchema, z.array(z.string().min(1)).min(1)).optional(),
153
+ markdown_abstract_valid_zones: z.array(MethodZoneIdSchema).optional(),
154
+ wikilinks_valid_in_zones: z.array(MethodZoneIdSchema).optional(),
257
155
  artifacts_must_not_contain: z.record(z.string(), z.array(z.string().min(1))).optional(),
258
156
  }).strict();
259
157
  export const RuntimeStageContractSchema = z.object({
@@ -263,8 +161,8 @@ export const RuntimeStageContractSchema = z.object({
263
161
  run_id: z.string(),
264
162
  target_type: RuntimeTargetTypeSchema,
265
163
  target_name: z.string(),
266
- workflow: z.object({
267
- id: WorkflowIdSchema,
164
+ method: z.object({
165
+ id: MethodIdSchema,
268
166
  stage_index: z.number().nullable(),
269
167
  stage_total: z.number(),
270
168
  stages: z.array(RuntimeStageSchema),
@@ -301,7 +199,7 @@ export const RuntimeRunSchema = z.object({
301
199
  run_id: z.string(),
302
200
  target_type: RuntimeTargetTypeSchema,
303
201
  target_name: z.string(),
304
- workflow: WorkflowIdSchema,
202
+ method: MethodIdSchema,
305
203
  stage: RuntimeStageSchema,
306
204
  stage_label: z.string(),
307
205
  contract_type: RuntimeContractTypeSchema,
@@ -324,9 +222,9 @@ export const RuntimeRunSchema = z.object({
324
222
  error: z.string().nullable(),
325
223
  });
326
224
  export const CompiledInventoryEntrySchema = z.object({
327
- input_zone: WorkflowZoneIdSchema.optional(),
225
+ input_zone: MethodZoneIdSchema.optional(),
328
226
  input_path: z.string().min(1).optional(),
329
- output_zone: WorkflowZoneIdSchema,
227
+ output_zone: MethodZoneIdSchema,
330
228
  output_path: z.string().min(1),
331
229
  state: z.string().min(1).optional(),
332
230
  metadata: JsonRecordSchema.optional(),
@@ -338,24 +236,7 @@ export const CompiledInventorySchema = z.object({
338
236
  entries: z.array(CompiledInventoryEntrySchema),
339
237
  total: z.number().int().nonnegative(),
340
238
  });
341
- export const TestCaseExpectSchema = z.object({
342
- must_include: z.array(z.string().min(1)).optional(),
343
- must_include_one_of: z.array(z.array(z.string().min(1)).min(1)).optional(),
344
- must_not_include: z.array(z.string().min(1)).optional(),
345
- min_words: z.number().int().nonnegative().optional(),
346
- max_words: z.number().int().nonnegative().optional(),
347
- }).refine((value) => value.min_words === undefined ||
348
- value.max_words === undefined ||
349
- value.max_words >= value.min_words, {
350
- message: "max_words must be greater than or equal to min_words",
351
- }).refine((value) => (value.must_include?.length ?? 0) > 0 ||
352
- (value.must_include_one_of?.length ?? 0) > 0 ||
353
- (value.must_not_include?.length ?? 0) > 0 ||
354
- value.min_words !== undefined ||
355
- value.max_words !== undefined, {
356
- message: "Test expectations must include at least one check",
357
- });
358
- export const WorkflowImprovementLoopSummarySchema = z.object({
239
+ export const MethodImprovementLoopSummarySchema = z.object({
359
240
  variation: z.number().int().min(1),
360
241
  kind: z.enum(["baseline", "edited"]),
361
242
  attempts_run: z.number().int().min(1),
@@ -367,17 +248,17 @@ export const WorkflowImprovementLoopSummarySchema = z.object({
367
248
  test_sandbox_path: z.string().nullable().optional(),
368
249
  summary: z.string().min(1),
369
250
  });
370
- export const WorkflowImprovementContextSchema = z.object({
371
- kind: z.literal("interf-workflow-improvement-loop"),
251
+ export const MethodImprovementContextSchema = z.object({
252
+ kind: z.literal("interf-method-improvement-loop"),
372
253
  version: z.literal(1),
373
254
  generated_at: z.string(),
374
255
  target_name: z.string(),
375
- workflow_id: WorkflowIdSchema,
256
+ method_id: MethodIdSchema,
376
257
  loop_index: z.number().int().min(1),
377
258
  max_loops: SourceCompiledMaxLoopsSchema,
378
259
  max_attempts: SourceCompiledMaxAttemptsSchema,
379
260
  review_paths: z.object({
380
- workflow_root: z.string(),
261
+ method_root: z.string(),
381
262
  compiled_runtime: z.string().nullable(),
382
263
  test_comparisons: z.string().nullable(),
383
264
  execution_shells: z.string().nullable(),
@@ -391,12 +272,13 @@ export const WorkflowImprovementContextSchema = z.object({
391
272
  question: z.string(),
392
273
  })),
393
274
  }),
394
- previous_variations: z.array(WorkflowImprovementLoopSummarySchema),
395
- latest_failure: WorkflowImprovementLoopSummarySchema.nullable(),
275
+ previous_variations: z.array(MethodImprovementLoopSummarySchema),
276
+ latest_failure: MethodImprovementLoopSummarySchema.nullable(),
396
277
  });
397
278
  export const PreservedShellTypeSchema = z.enum([
398
279
  "stage-execution",
399
- "workflow-improvement",
280
+ "method-authoring",
281
+ "method-improvement",
400
282
  ]);
401
283
  export const PreservedShellSnapshotSchema = z.object({
402
284
  kind: z.literal("interf-preserved-shell"),
@@ -406,20 +288,20 @@ export const PreservedShellSnapshotSchema = z.object({
406
288
  root_path: z.string(),
407
289
  materialized_symlinks: z.number().int().min(0),
408
290
  });
409
- export const WorkflowPackageValidationSchema = z.object({
291
+ export const MethodPackageValidationSchema = z.object({
410
292
  ok: z.boolean(),
411
293
  summary: z.string(),
412
294
  errors: z.array(z.string()),
413
295
  counts: z.record(z.string(), z.number()),
414
296
  });
415
- export const WorkflowImprovementLoopRecordSchema = z.object({
416
- kind: z.literal("interf-workflow-improvement-loop-record"),
297
+ export const MethodImprovementLoopRecordSchema = z.object({
298
+ kind: z.literal("interf-method-improvement-loop-record"),
417
299
  version: z.literal(1),
418
300
  recorded_at: z.string(),
419
301
  run_id: z.string(),
420
302
  loop_index: z.number().int().min(1),
421
303
  target_name: z.string(),
422
- workflow_id: WorkflowIdSchema,
304
+ method_id: MethodIdSchema,
423
305
  result: z.enum(["updated", "no-change", "invalid", "executor-failed"]),
424
306
  changed: z.boolean(),
425
307
  applied: z.boolean(),
@@ -427,23 +309,23 @@ export const WorkflowImprovementLoopRecordSchema = z.object({
427
309
  shell_path: z.string(),
428
310
  loop_root_path: z.string(),
429
311
  context_path: z.string(),
430
- workflow_before_path: z.string(),
431
- workflow_after_path: z.string(),
312
+ method_before_path: z.string(),
313
+ method_after_path: z.string(),
432
314
  prompt_log_path: z.string(),
433
315
  event_log_path: z.string(),
434
316
  status_log_path: z.string(),
435
317
  preserved_shell_manifest_path: z.string().nullable(),
436
- validation: WorkflowPackageValidationSchema.nullable(),
318
+ validation: MethodPackageValidationSchema.nullable(),
437
319
  });
438
- export const WorkflowImprovementRunLedgerSchema = z.object({
439
- kind: z.literal("interf-workflow-improvement-run"),
320
+ export const MethodImprovementRunLedgerSchema = z.object({
321
+ kind: z.literal("interf-method-improvement-run"),
440
322
  version: z.literal(1),
441
323
  generated_at: z.string(),
442
324
  updated_at: z.string(),
443
325
  run_id: z.string(),
444
326
  target_name: z.string(),
445
- workflow_id: WorkflowIdSchema,
327
+ method_id: MethodIdSchema,
446
328
  max_loops: SourceCompiledMaxLoopsSchema,
447
329
  max_attempts: SourceCompiledMaxAttemptsSchema,
448
- loops: z.array(WorkflowImprovementLoopRecordSchema),
330
+ loops: z.array(MethodImprovementLoopRecordSchema),
449
331
  });
@@ -1,6 +1,6 @@
1
1
  import { type InterfConfig } from "../project-model/interf-detect.js";
2
- export type { WorkflowReporter, WorkflowStageResult, LocalSkillContractExtension } from "../workflow-package/workflow-helpers.js";
3
- export { workflowQueryDirectory, workflowImproveDirectory, workflowCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../workflow-package/workflow-helpers.js";
2
+ export type { MethodReporter, MethodStageResult, LocalSkillContractExtension } from "../method-package/method-helpers.js";
3
+ export { methodQueryDirectory, methodImproveDirectory, methodCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../method-package/method-helpers.js";
4
4
  export type CompiledCheck = "compiled" | "stage";
5
5
  export interface DetectedInterfTarget {
6
6
  path: string;
@@ -9,7 +9,7 @@ export interface DetectedInterfTarget {
9
9
  config: InterfConfig;
10
10
  }
11
11
  export declare function detectCompiled(cwd: string): DetectedInterfTarget | null;
12
- export declare function createCompiled(name: string, sourcePath: string, workflowId?: string, about?: string, datasetPath?: string): string;
13
- export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledWorkflowValidation;
12
+ export declare function createCompiled(name: string, sourcePath: string, methodId?: string, about?: string, sourceFolderPath?: string): string;
13
+ export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
14
14
  export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
15
15
  export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
@@ -1,7 +1,8 @@
1
1
  import { createCompiled as createCompiledScaffold, } from "../project-model/interf-scaffold.js";
2
2
  import { detectInterf } from "../project-model/interf-detect.js";
3
3
  import { validateCompiledCompile, } from "./validate.js";
4
- export { workflowQueryDirectory, workflowImproveDirectory, workflowCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../workflow-package/workflow-helpers.js";
4
+ import { DEFAULT_METHOD_ID } from "../methods/method-resolution.js";
5
+ export { methodQueryDirectory, methodImproveDirectory, methodCompileStageDirectory, emptyLocalSkillContractExtension, buildLocalSkillContractExtension, buildLocalSkillContractExtensionRelativeTo, mergeLocalSkillContractExtensions, buildStageInstructions, reportLine, reportBlankLine, reportValidationFailure, resolveStageAcceptance, validateStageOutcome, } from "../method-package/method-helpers.js";
5
6
  export function detectCompiled(cwd) {
6
7
  const detected = detectInterf(cwd);
7
8
  if (!detected)
@@ -13,8 +14,8 @@ export function detectCompiled(cwd) {
13
14
  config: detected.config,
14
15
  };
15
16
  }
16
- export function createCompiled(name, sourcePath, workflowId = "interf", about, datasetPath = sourcePath) {
17
- return createCompiledScaffold(name, sourcePath, workflowId, about, datasetPath);
17
+ export function createCompiled(name, sourcePath, methodId = DEFAULT_METHOD_ID, about, sourceFolderPath = sourcePath) {
18
+ return createCompiledScaffold(name, sourcePath, methodId, about, sourceFolderPath);
18
19
  }
19
20
  export function verifyCompiledCheck(check, compiledPath) {
20
21
  switch (check) {
@@ -27,21 +27,14 @@ export declare function resolveCompiledRawPath(compiledPath: string, config?: {
27
27
  path: string;
28
28
  control_path?: string | undefined;
29
29
  preparation_path?: string | undefined;
30
- source_folder_path?: string | undefined;
31
- dataset_path?: string | undefined;
32
30
  };
33
31
  about?: string | undefined;
34
- workflow?: string | undefined;
35
32
  max_attempts?: number | undefined;
36
33
  max_loops?: number | undefined;
37
34
  method_origin?: {
38
35
  selected: string;
39
36
  local_draft?: boolean | undefined;
40
37
  } | undefined;
41
- workflow_origin?: {
42
- selected: string;
43
- local_draft?: boolean | undefined;
44
- } | undefined;
45
38
  } | null): string;
46
39
  export declare function syncCompiledRawSnapshot(compiledPath: string, sourcePath?: string): CompiledRawSyncResult;
47
40
  export declare function ensureCompiledRawBinding(compiledPath: string): InterfConfig | null;
@@ -36,7 +36,6 @@ export function ensureCompiledRawBinding(compiledPath) {
36
36
  ...(config.source ?? {}),
37
37
  path: "./raw",
38
38
  control_path: config.source?.control_path ?? defaultControlPathForCompiled(compiledPath),
39
- ...(config.source?.dataset_path ? { dataset_path: config.source.dataset_path } : {}),
40
39
  },
41
40
  };
42
41
  return saveCompiledInterfConfig(compiledPath, nextConfig);
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, rmSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { readCompiledSchemaFile } from "./compiled-schema.js";
4
4
  import { initializeCompiledRuntimeState } from "./state.js";
5
- import { stageExecutionShellsRoot, testRootForCompiled, testTargetsRootForCompiled, workflowImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeRoot, compiledRuntimeLogsRoot, workflowPackagePathForCompiled, } from "./compiled-paths.js";
5
+ import { stageExecutionShellsRoot, testRootForCompiled, testTargetsRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeRoot, compiledRuntimeLogsRoot, methodPackagePathForCompiled, } from "./compiled-paths.js";
6
6
  function removeIfExists(path) {
7
7
  if (existsSync(path)) {
8
8
  rmSync(path, { recursive: true, force: true });
@@ -36,7 +36,7 @@ export function clearCompiledRuntimeDerivedArtifacts(compiledPath) {
36
36
  removeIfExists(compiledQueryAcceptanceRoot(compiledPath));
37
37
  }
38
38
  function activeCompiledInputRoots(compiledPath) {
39
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
39
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
40
40
  const roots = new Set();
41
41
  for (const zone of schema?.zones ?? []) {
42
42
  if (zone.role !== "input")
@@ -63,7 +63,7 @@ export function resetCompiledGeneratedState(compiledPath, scope = "compile") {
63
63
  initializeCompiledRuntimeState(compiledPath);
64
64
  if (scope === "all") {
65
65
  removeIfExists(stageExecutionShellsRoot(compiledPath));
66
- removeIfExists(workflowImprovementLoopsRoot(compiledPath));
66
+ removeIfExists(methodImprovementLoopsRoot(compiledPath));
67
67
  removeIfExists(compiledRuntimeLogsRoot(compiledPath));
68
68
  removeIfExists(join(compiledRuntimeRoot(compiledPath), "run-history.jsonl"));
69
69
  removeIfExists(testRootForCompiled(compiledPath));
@@ -2,12 +2,13 @@ import { existsSync, } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { listFilesRecursive } from "../shared/filesystem.js";
4
4
  import { readJsonFileWithSchema } from "../shared/parse.js";
5
- import { WORKFLOW_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
5
+ import { METHOD_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
6
6
  import { RuntimeStageContractSchema, } from "./lib/schema.js";
7
7
  import { stageContractPath } from "./runtime-paths.js";
8
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
8
+ import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
9
  import { loadState } from "./state-io.js";
10
10
  import { countBrokenWikilinks, isOutputMarkdownFile, safeReadText, validateSynthFiles } from "./validate.js";
11
+ import { countCompiledZoneArtifacts } from "./artifact-counts.js";
11
12
  function toFiniteNumber(value) {
12
13
  if (typeof value !== "number" || !Number.isFinite(value))
13
14
  return null;
@@ -41,14 +42,6 @@ function readPathValue(record, keyPath) {
41
42
  return current[segment];
42
43
  }, record);
43
44
  }
44
- function countZoneArtifacts(compiledPath, zonePath, kind) {
45
- const absolutePath = compiledZoneAbsolutePath(compiledPath, { path: zonePath });
46
- if (!existsSync(absolutePath))
47
- return 0;
48
- if (kind === "file")
49
- return 1;
50
- return listFilesRecursive(absolutePath).length;
51
- }
52
45
  function markdownFilesForZone(compiledPath, zonePath, kind) {
53
46
  const absolutePath = compiledZoneAbsolutePath(compiledPath, { path: zonePath });
54
47
  if (!existsSync(absolutePath))
@@ -59,7 +52,7 @@ function markdownFilesForZone(compiledPath, zonePath, kind) {
59
52
  return listFilesRecursive(absolutePath, isOutputMarkdownFile);
60
53
  }
61
54
  function zoneRoots(compiledPath, acceptanceZones) {
62
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
55
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
63
56
  if (!schema)
64
57
  return [];
65
58
  return acceptanceZones
@@ -103,12 +96,12 @@ export function validateResolvedStageAcceptance(dirPath, options) {
103
96
  failures: [],
104
97
  };
105
98
  }
106
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
99
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
107
100
  if (!schema) {
108
101
  return {
109
102
  ok: false,
110
- summary: `Stage acceptance failed for ${options.stageId}: missing workflow schema.`,
111
- failures: [`Missing method/${WORKFLOW_SCHEMA_FILE}.`],
103
+ summary: `Stage acceptance failed for ${options.stageId}: missing Method schema.`,
104
+ failures: [`Missing method/${METHOD_SCHEMA_FILE}.`],
112
105
  };
113
106
  }
114
107
  const failures = [];
@@ -159,7 +152,7 @@ export function validateResolvedStageAcceptance(dirPath, options) {
159
152
  failures.push(`Acceptance references unknown zone "${zoneId}".`);
160
153
  continue;
161
154
  }
162
- const actual = countZoneArtifacts(dirPath, zone.path, zone.kind);
155
+ const actual = countCompiledZoneArtifacts(dirPath, zone.path, zone.kind);
163
156
  if (actual < minimum) {
164
157
  failures.push(`Expected zone "${zoneId}" to contain at least ${minimum} artifact(s), got ${actual}.`);
165
158
  }
@@ -175,7 +168,7 @@ export function validateResolvedStageAcceptance(dirPath, options) {
175
168
  failures.push(`Acceptance references missing count "${countKey}" for zone "${zoneId}".`);
176
169
  continue;
177
170
  }
178
- const actual = countZoneArtifacts(dirPath, zone.path, zone.kind);
171
+ const actual = countCompiledZoneArtifacts(dirPath, zone.path, zone.kind);
179
172
  if (actual < expected) {
180
173
  failures.push(`Expected zone "${zoneId}" to contain at least count "${countKey}" (${expected}) artifact(s), got ${actual}.`);
181
174
  }
@@ -1,7 +1,7 @@
1
- import { WORKFLOW_SCHEMA_FILE } from "./compiled-schema.js";
1
+ import { METHOD_SCHEMA_FILE } from "./compiled-schema.js";
2
2
  export function buildRuntimeStageContract(options) {
3
3
  const localSkillDocs = options.localSkillDocs ?? [];
4
- const workflowNotes = options.workflowNotes ?? [];
4
+ const methodNotes = options.methodNotes ?? [];
5
5
  return {
6
6
  instructions: options.instructions,
7
7
  counts: {
@@ -12,7 +12,7 @@ export function buildRuntimeStageContract(options) {
12
12
  artifacts: {
13
13
  reads: [
14
14
  "interf.json",
15
- `method/${WORKFLOW_SCHEMA_FILE}`,
15
+ `method/${METHOD_SCHEMA_FILE}`,
16
16
  ...(options.extraReadArtifacts ?? []),
17
17
  ...options.stageReadArtifacts,
18
18
  ...localSkillDocs,
@@ -26,19 +26,19 @@ export function buildRuntimeStageContract(options) {
26
26
  execution_mode: "deterministic",
27
27
  status_prefixes: ["STATUS:", "DONE:", "BLOCKED:", "ERROR:"],
28
28
  notes: [
29
- `This is the "${options.stageLabel}" stage for the compiled context "${options.compiledName}".`,
30
- "The workflow package is the authoritative method layer for this run.",
31
- `Use \`method/${WORKFLOW_SCHEMA_FILE}\` as the deterministic context-interface reference for this portable context.`,
32
- "Honor the declared read and write artifacts instead of inventing a parallel workflow.",
29
+ `This is the "${options.stageLabel}" stage for the portable context "${options.compiledName}".`,
30
+ "The Method package is the authoritative method layer for this run.",
31
+ `Use \`method/${METHOD_SCHEMA_FILE}\` as the deterministic context-interface reference for this portable context.`,
32
+ "Honor the declared read and write artifacts instead of inventing a parallel process.",
33
33
  "Only create or update files that fall under the declared write targets for this stage.",
34
34
  "Interf writes `.interf/runtime/` ledgers such as run, state, health, and view-spec files. Read them if needed, but do not create, edit, or replace them in this stage unless the contract explicitly marks a runtime artifact as stage-owned.",
35
35
  "Keep scratch extraction commands single-purpose and non-destructive. Avoid wildcard cleanup and multi-command chains.",
36
- ...workflowNotes,
36
+ ...methodNotes,
37
37
  ...(localSkillDocs.length > 0
38
38
  ? [
39
39
  "Read any local instruction docs listed in the contract before you write artifacts or declare the stage complete.",
40
40
  options.instructions.effective_mode === "override"
41
- ? "Local stage docs replace the default workflow guidance for this run, but they still do not bypass required writes, declared proof artifacts, or deterministic runtime reconciliation."
41
+ ? "Local stage docs replace the default method guidance for this run, but they still do not bypass required writes, declared proof artifacts, or deterministic runtime reconciliation."
42
42
  : "Local stage docs can refine the stage behavior, but they do not bypass required writes, declared proof artifacts, or deterministic runtime reconciliation.",
43
43
  ]
44
44
  : []),
@@ -3,16 +3,16 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
3
3
  const modeNotes = instructions.effective_mode === "override"
4
4
  ? [
5
5
  "Local stage instruction docs are authoritative for this run.",
6
- "Use bundled workflow heuristics only when the stage contract explicitly permits them.",
6
+ "Use bundled Method heuristics only when the stage contract explicitly permits them.",
7
7
  "Interf still enforces the same required reads, writes, verifier outputs, and runtime reconciliation at stage close.",
8
8
  ]
9
9
  : instructions.effective_mode === "extend"
10
10
  ? [
11
- "Use the current compiled workflow docs as the default workflow for this run.",
11
+ "Use the current compiled Method docs as the default Method for this run.",
12
12
  "Then apply any additional local stage instruction docs referenced by the contract as stage-specific extensions.",
13
13
  ]
14
14
  : [
15
- "Use the current compiled workflow docs as the default workflow for this run.",
15
+ "Use the current compiled Method docs as the default Method for this run.",
16
16
  ];
17
17
  return [
18
18
  `Interf Method stage docs: method/compile/stages/${stageSkillDir}/`,
@@ -31,7 +31,7 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
31
31
  "If `AGENTS.md` is listed in the contract, use it only for portable-context routing that is directly relevant to this stage.",
32
32
  "`.interf/runtime/run.json`, `.interf/runtime/state.json`, `.interf/runtime/health.json`, and `.interf/runtime/view-spec.json` are runtime artifacts written by Interf. You may read them, but do not create, edit, or replace them unless the contract explicitly marks a different proof artifact as stage-owned.",
33
33
  "If a contract-listed output file does not exist yet, create it in one whole-file write. Do not attempt patch-style edits against a missing runtime path.",
34
- "Stay inside the current compiled context. Do not try to open repo docs, repo source files, or other paths outside the compiled context unless the stage contract explicitly requires them.",
34
+ "Stay inside the current portable context. Do not try to open repo docs, repo source files, or other paths outside the portable context unless the stage contract explicitly requires them.",
35
35
  instructions.effective_mode === "override"
36
36
  ? "Do not depend on any repo-root or globally installed skill cache for this run. Local stage instruction docs are the primary Method layer for this run."
37
37
  : "Do not depend on any repo-root or globally installed skill cache for this run. Use the current compiled Method docs and the contract as the default behavior.",
@@ -1,2 +1,2 @@
1
- import { type WorkflowStageDefinition } from "../workflow-package/workflow-definitions.js";
2
- export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<WorkflowStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;
1
+ import { type MethodStageDefinition } from "../method-package/method-definitions.js";
2
+ export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<MethodStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;