@interf/compiler 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) 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/13g~4mamjft.c.css → dist/compiler-ui/_next/static/chunks/0c9mu7yldxyyg.css} +1 -1
  44. package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/15mks7ry_cupt.js} +15 -21
  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 +0 -1
  114. package/dist/packages/local-service/action-values.js +0 -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 +536 -974
  120. package/dist/packages/local-service/lib/schema.js +43 -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 +302 -880
  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/builtin-workflows/interf/improve/SKILL.md +0 -18
  192. package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
  193. package/dist/packages/project-model/compiled-paths.d.ts +0 -1
  194. package/dist/packages/project-model/compiled-paths.js +0 -1
  195. package/dist/packages/project-model/compiled-raw.d.ts +0 -1
  196. package/dist/packages/project-model/compiled-raw.js +0 -1
  197. package/dist/packages/project-model/compiled-reset.d.ts +0 -1
  198. package/dist/packages/project-model/compiled-reset.js +0 -1
  199. package/dist/packages/shared/index.d.ts +0 -7
  200. package/dist/packages/shared/index.js +0 -7
  201. package/dist/packages/shared/util.d.ts +0 -3
  202. package/dist/packages/shared/util.js +0 -3
  203. package/dist/packages/testing/test-matrices.d.ts +0 -90
  204. package/dist/packages/testing/test-matrices.js +0 -96
  205. package/dist/packages/workflow-authoring/index.d.ts +0 -4
  206. package/dist/packages/workflow-authoring/index.js +0 -4
  207. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
  208. package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
  209. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
  210. package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
  211. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
  212. package/dist/packages/workflow-package/index.d.ts +0 -11
  213. package/dist/packages/workflow-package/index.js +0 -11
  214. package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
  215. package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
  216. package/dist/packages/workflow-package/local-workflows.js +0 -457
  217. package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
  218. package/dist/packages/workflow-package/workflow-definitions.js +0 -211
  219. package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
  220. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
  221. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
  222. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
  223. /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
  224. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
  225. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
  226. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
  227. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
  228. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
  229. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
  230. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
  231. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
  232. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
  233. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
  234. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
  235. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
  236. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
  237. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
  238. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
  239. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  240. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  241. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
  242. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_buildManifest.js +0 -0
  243. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_clientMiddlewareManifest.js +0 -0
  244. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_ssgManifest.js +0 -0
  245. /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
  246. /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
  247. /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
  248. /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
  249. /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
  250. /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
@@ -3,12 +3,12 @@ import { tmpdir } from "node:os";
3
3
  import { basename, dirname, join, relative } from "node:path";
4
4
  import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
5
5
  import { projectRawSnapshot } from "../../compiler/raw-snapshot.js";
6
- import { WORKFLOW_PACKAGE_DIR } from "../../project-model/interf-detect.js";
7
- import { CONTEXT_INTERFACE_FILE as WORKFLOW_SCHEMA_FILE, contextInterfaceZoneAbsolutePath as compiledZoneAbsolutePath, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveWorkflowSchemaPath, } from "../../workflow-package/context-interface.js";
8
- import { stageExecutionShellsRoot, workflowImprovementLoopRoot, workflowPackagePathForCompiled, compiledInterfConfigPath, compiledRuntimeRoot, } from "../../compiler/compiled-paths.js";
6
+ import { METHOD_PACKAGE_DIR } from "../../project-model/interf-detect.js";
7
+ import { CONTEXT_INTERFACE_FILE as METHOD_SCHEMA_FILE, contextInterfaceZoneAbsolutePath as compiledZoneAbsolutePath, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveMethodSchemaPath, } from "../../method-package/context-interface.js";
8
+ import { stageExecutionShellsRoot, methodImprovementLoopRoot, methodPackagePathForCompiled, compiledInterfConfigPath, compiledRuntimeRoot, } from "../../compiler/compiled-paths.js";
9
9
  import { ensureCompiledZoneTargets } from "../../compiler/compiled-schema.js";
10
10
  import { listFilesRecursive } from "../../shared/filesystem.js";
11
- import { resolveWorkflowImprovementReviewSourcePaths } from "../../workflow-package/workflow-review-paths.js";
11
+ import { resolveMethodImprovementReviewSourcePaths } from "../../method-package/method-review-paths.js";
12
12
  const LOCAL_SKILL_ROOTS = [
13
13
  ".claude/skills",
14
14
  ".codex/skills",
@@ -24,19 +24,19 @@ export function writeNativeAgentSurface(rootPath, agentsContent, skillName, skil
24
24
  return changed;
25
25
  }
26
26
  function compiledQuerySkillSourcePath(compiledPath) {
27
- return join(workflowPackagePathForCompiled(compiledPath), "use", "query", "SKILL.md");
27
+ return join(methodPackagePathForCompiled(compiledPath), "use", "query", "SKILL.md");
28
28
  }
29
29
  function compiledZoneSummaryLines(compiledPath) {
30
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
30
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
31
31
  if (!schema)
32
- return ["- No workflow schema is available yet."];
32
+ return ["- No Method schema is available yet."];
33
33
  return schema.zones
34
34
  .filter((zone) => zone.kind !== "runtime")
35
35
  .map((zone) => `- \`${zone.id}\` -> \`${zone.path}\` (${zone.role} ${zone.kind})`);
36
36
  }
37
- export function renderCompiledAgents(compiledPath, name, workflowId, about, options = {}) {
38
- const workflowOriginSelected = options.workflowOriginSelected ?? workflowId;
39
- const workflowLocalDraft = options.workflowLocalDraft === true;
37
+ export function renderCompiledAgents(compiledPath, name, methodId, about, options = {}) {
38
+ const methodOriginSelected = options.methodOriginSelected ?? methodId;
39
+ const methodLocalDraft = options.methodLocalDraft === true;
40
40
  const zoneLines = compiledZoneSummaryLines(compiledPath);
41
41
  return [
42
42
  `# ${name}`,
@@ -53,29 +53,29 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
53
53
  "## How to use this portable context",
54
54
  "",
55
55
  "1. Use the local native `interf-query` skill that Interf generated for this portable context.",
56
- "2. Let the workflow docs and declared output zones guide retrieval instead of assuming a fixed note layout.",
56
+ "2. Let the Method docs and declared output zones guide retrieval instead of assuming a fixed note layout.",
57
57
  "3. Use `raw/` when you need direct quotes, exact chart values, table lookups, or verification.",
58
58
  "",
59
59
  "## How this portable context works",
60
60
  "",
61
61
  "- The Method package defines the context interface this portable context implements on disk.",
62
62
  "- `.interf/interf.json` points to the local `raw/` snapshot via `source.path` and back to the Interf Workspace via `source.control_path`.",
63
- `- Method seed: \`${workflowOriginSelected}\`.`,
64
- ...(workflowLocalDraft
63
+ `- Method seed: \`${methodOriginSelected}\`.`,
64
+ ...(methodLocalDraft
65
65
  ? ["- This portable context now carries a local Method draft improved from that seed. Recompiling this portable context reuses the local `.interf/method/` package."]
66
66
  : []),
67
- `- Active local Method id: \`${workflowId}\`.`,
67
+ `- Active local Method id: \`${methodId}\`.`,
68
68
  "- `.interf/method/` is the local editable Method package for this portable context.",
69
- `- \`.interf/method/${WORKFLOW_SCHEMA_FILE}\` is the deterministic context interface for this portable context.`,
69
+ `- \`.interf/method/${METHOD_SCHEMA_FILE}\` is the deterministic context interface for this portable context.`,
70
70
  "- `.interf/method/improve/` is the editable source for Method-improvement loops.",
71
71
  "- `.interf/method/use/query/` is the editable source for the generated native query shell.",
72
72
  "- `.interf/method/compile/stages/` defines stage-specific docs that Interf projects into native execution shells for automated runs.",
73
73
  "- Native local query skills are generated under local agent skill directories such as `.claude/skills/` and `.codex/skills/`.",
74
74
  "- `raw/` contains the local raw snapshot used for evidence and verification.",
75
- `- Method zones are declared in \`.interf/method/${WORKFLOW_SCHEMA_FILE}\`.`,
75
+ `- Method zones are declared in \`.interf/method/${METHOD_SCHEMA_FILE}\`.`,
76
76
  ...zoneLines,
77
77
  "- `.interf/runtime/` holds runtime artifacts written by Interf.",
78
- "- `.interf/tests/` mirrors the latest saved comparison and keeps detailed target runs plus preserved sandboxes.",
78
+ "- `.interf/tests/` mirrors the latest saved readiness-check run and keeps detailed target runs plus preserved sandboxes.",
79
79
  "- `.interf/tests/targets/` holds detailed raw and compiled target runs plus preserved test sandboxes.",
80
80
  "",
81
81
  "## Manual query rules",
@@ -91,8 +91,8 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
91
91
  "```",
92
92
  "interf compile build this portable context",
93
93
  "interf test run checks against this portable context",
94
- "interf verify stage <id> verify one workflow stage",
95
- "interf verify compiled verify the full portable context output",
94
+ "interf verify stage <id> verify one Method stage",
95
+ "interf verify portable-context verify the full portable context output",
96
96
  "interf status show deterministic health",
97
97
  "```",
98
98
  "",
@@ -112,7 +112,7 @@ export function renderCompiledQuerySkill() {
112
112
  "",
113
113
  "Default loop:",
114
114
  "1. Read `.interf/method/README.md` and this file first.",
115
- `2. Use the Method zones declared in \`.interf/method/${WORKFLOW_SCHEMA_FILE}\` before consulting \`raw/\`.`,
115
+ `2. Use the Method zones declared in \`.interf/method/${METHOD_SCHEMA_FILE}\` before consulting \`raw/\`.`,
116
116
  "3. Use `raw/` for direct quotes, verification, exact lookups, and cases where the portable context is missing the needed evidence or is ambiguous.",
117
117
  "",
118
118
  "Answering rule:",
@@ -133,7 +133,7 @@ function renderRawTestAgents() {
133
133
  "# Raw Test Shell",
134
134
  "",
135
135
  "This is an isolated raw-files test shell generated by Interf.",
136
- "There is no compiled context in this shell.",
136
+ "There is no portable context in this shell.",
137
137
  "",
138
138
  "## How to use this shell",
139
139
  "",
@@ -144,7 +144,7 @@ function renderRawTestAgents() {
144
144
  "## Rules",
145
145
  "",
146
146
  "- Answer only from the files under `raw/`.",
147
- "- There is no compiled context here, so do not assume any compiled-context output zones exist.",
147
+ "- There is no portable context here, so do not assume any portable-context output zones exist.",
148
148
  "- Do not treat hidden runtime files or test artifacts as evidence.",
149
149
  ...chartNotes,
150
150
  "- Write the requested answer and trace files, then stop.",
@@ -169,7 +169,7 @@ function renderRawTestQuerySkill() {
169
169
  "1. Read `raw/` directly.",
170
170
  "2. Verify exact claims against the raw files before answering strongly.",
171
171
  ...chartNotes,
172
- "8. Do not rely on compiled context artifacts because they do not exist in this shell.",
172
+ "8. Do not rely on portable-context artifacts because they do not exist in this shell.",
173
173
  "",
174
174
  ].join("\n");
175
175
  }
@@ -180,8 +180,8 @@ function readCompiledQuerySkillSource(compiledPath) {
180
180
  }
181
181
  return readFileSync(filePath, "utf8").trim();
182
182
  }
183
- function stageShellWorkflowRoot(shellRoot) {
184
- return join(shellRoot, WORKFLOW_PACKAGE_DIR);
183
+ function stageShellMethodRoot(shellRoot) {
184
+ return join(shellRoot, METHOD_PACKAGE_DIR);
185
185
  }
186
186
  function shellInputZonePath(shellRoot, zoneId) {
187
187
  return join(shellRoot, "inputs", zoneId);
@@ -230,10 +230,10 @@ function linkRelativePath(targetPath, linkPathname) {
230
230
  symlinkSync(relative(dirname(linkPathname), targetPath), linkPathname);
231
231
  }
232
232
  function loadCompiledSchema(compiledPath) {
233
- const workflowRoot = workflowPackagePathForCompiled(compiledPath);
234
- const schema = readCompiledSchemaFile(workflowRoot);
233
+ const methodRoot = methodPackagePathForCompiled(compiledPath);
234
+ const schema = readCompiledSchemaFile(methodRoot);
235
235
  if (!schema) {
236
- throw new Error(`Missing workflow schema at ${join(workflowRoot, WORKFLOW_SCHEMA_FILE)}`);
236
+ throw new Error(`Missing Method schema at ${join(methodRoot, METHOD_SCHEMA_FILE)}`);
237
237
  }
238
238
  return schema;
239
239
  }
@@ -243,7 +243,7 @@ function zoneMap(schema) {
243
243
  function zoneOrThrow(zones, zoneId) {
244
244
  const zone = zones.get(zoneId);
245
245
  if (!zone) {
246
- throw new Error(`Missing workflow schema zone "${zoneId}" for stage shell projection.`);
246
+ throw new Error(`Missing Method schema zone "${zoneId}" for stage shell projection.`);
247
247
  }
248
248
  return zone;
249
249
  }
@@ -298,21 +298,21 @@ function ensureShellLocalProjection(sourcePath, targetPath, zone) {
298
298
  }
299
299
  function ensureCompiledExecutionSurface(compiledPath) {
300
300
  mkdirSync(compiledRuntimeRoot(compiledPath), { recursive: true });
301
- mkdirSync(workflowPackagePathForCompiled(compiledPath), { recursive: true });
301
+ mkdirSync(methodPackagePathForCompiled(compiledPath), { recursive: true });
302
302
  const schema = loadCompiledSchema(compiledPath);
303
303
  ensureCompiledZoneTargets(compiledPath, schema);
304
304
  return schema;
305
305
  }
306
306
  function readStageMethodDoc(compiledPath, stage) {
307
- const path = join(workflowPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir, "SKILL.md");
307
+ const path = join(methodPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir, "SKILL.md");
308
308
  if (!existsSync(path))
309
309
  return null;
310
310
  return readFileSync(path, "utf8").trim();
311
311
  }
312
- function stageWorkflowDocsPath(compiledPath, stage) {
313
- return join(workflowPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir);
312
+ function stageMethodDocsPath(compiledPath, stage) {
313
+ return join(methodPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir);
314
314
  }
315
- function renderStageExecutionAgents(compiledName, workflowId, stage) {
315
+ function renderStageExecutionAgents(compiledName, methodId, stage) {
316
316
  return [
317
317
  `# ${compiledName} — ${stage.label} Execution Shell`,
318
318
  "",
@@ -333,14 +333,14 @@ function renderStageExecutionAgents(compiledName, workflowId, stage) {
333
333
  "- For file zones, `runtime/paths.json` points to the exact file path inside those mount roots.",
334
334
  "- declared compiled zone paths are also projected at the shell root so Method-relative contract paths stay valid.",
335
335
  "- `runtime/` = stage contract and machine-readable path map for this shell.",
336
- "- `method/` = Method metadata, workflow schema, and docs for the current stage only.",
336
+ "- `method/` = Method metadata, `method.schema.json`, and docs for the current stage only.",
337
337
  "",
338
338
  "## Boundaries",
339
339
  "",
340
- `- Workflow: \`${workflowId}\`.`,
340
+ `- Method: \`${methodId}\`.`,
341
341
  `- Contract type: \`${stage.contractType}\`.`,
342
- "- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the compiled-context query shell.",
343
- "- The compiled context root itself is not linked into this shell.",
342
+ "- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the portable-context query shell.",
343
+ "- The portable context root itself is not linked into this shell.",
344
344
  "- Do not switch into query mode or act like a user-facing assistant.",
345
345
  "- Do not modify files under `inputs/` unless the same zone is also mounted under `outputs/`.",
346
346
  "",
@@ -412,25 +412,25 @@ function renderCompiledQueryNativeSkill(querySkillContent) {
412
412
  "",
413
413
  ].join("\n");
414
414
  }
415
- function projectWorkflowMetadata(compiledPath, shellRoot, stage) {
416
- const shellWorkflowRoot = stageShellWorkflowRoot(shellRoot);
417
- mkdirSync(join(shellWorkflowRoot, "compile", "stages"), { recursive: true });
418
- const compiledWorkflowRoot = workflowPackagePathForCompiled(compiledPath);
419
- const workflowJsonPath = join(compiledWorkflowRoot, "workflow.json");
420
- if (existsSync(workflowJsonPath)) {
421
- linkPath(workflowJsonPath, join(shellWorkflowRoot, "workflow.json"));
415
+ function projectMethodMetadata(compiledPath, shellRoot, stage) {
416
+ const shellMethodRoot = stageShellMethodRoot(shellRoot);
417
+ mkdirSync(join(shellMethodRoot, "compile", "stages"), { recursive: true });
418
+ const compiledMethodRoot = methodPackagePathForCompiled(compiledPath);
419
+ const methodJsonPath = join(compiledMethodRoot, "method.json");
420
+ if (existsSync(methodJsonPath)) {
421
+ linkPath(methodJsonPath, join(shellMethodRoot, "method.json"));
422
422
  }
423
- const compiledSchemaPath = resolveWorkflowSchemaPath(compiledWorkflowRoot);
423
+ const compiledSchemaPath = resolveMethodSchemaPath(compiledMethodRoot);
424
424
  if (compiledSchemaPath) {
425
- linkPath(compiledSchemaPath, join(shellWorkflowRoot, WORKFLOW_SCHEMA_FILE));
425
+ linkPath(compiledSchemaPath, join(shellMethodRoot, METHOD_SCHEMA_FILE));
426
426
  }
427
- const readmePath = join(compiledWorkflowRoot, "README.md");
427
+ const readmePath = join(compiledMethodRoot, "README.md");
428
428
  if (existsSync(readmePath)) {
429
- linkPath(readmePath, join(shellWorkflowRoot, "README.md"));
429
+ linkPath(readmePath, join(shellMethodRoot, "README.md"));
430
430
  }
431
- const stageDocsPath = stageWorkflowDocsPath(compiledPath, stage);
431
+ const stageDocsPath = stageMethodDocsPath(compiledPath, stage);
432
432
  if (existsSync(stageDocsPath)) {
433
- linkPath(stageDocsPath, join(shellWorkflowRoot, "compile", "stages", stage.skillDir));
433
+ linkPath(stageDocsPath, join(shellMethodRoot, "compile", "stages", stage.skillDir));
434
434
  }
435
435
  }
436
436
  function projectCompiledSchemaZones(compiledPath, shellRoot, schema, zoneIds, materializedZoneIds) {
@@ -481,11 +481,11 @@ function projectStageZoneMountAliases(shellRoot, stage, schema) {
481
481
  }
482
482
  }
483
483
  }
484
- function writeExecutionShellPathsFile(shellRoot, workflowId, stage, mounts) {
484
+ function writeExecutionShellPathsFile(shellRoot, methodId, stage, mounts) {
485
485
  const paths = {
486
486
  kind: "interf-execution-shell",
487
487
  version: 1,
488
- workflow: workflowId,
488
+ method: methodId,
489
489
  stage: stage.id,
490
490
  reads: mounts.reads,
491
491
  writes: mounts.writes,
@@ -661,93 +661,97 @@ export function renderClaudeBootstrap(content) {
661
661
  "",
662
662
  ].join("\n");
663
663
  }
664
- function renderWorkflowAuthoringAgents(options) {
664
+ function renderMethodAuthoringAgents(options) {
665
665
  return [
666
- `# ${options.label} — Workflow Authoring Shell`,
666
+ `# ${options.label} — Method Authoring Shell`,
667
667
  "",
668
- "This is an automated workflow-authoring shell generated by Interf.",
669
- "It exists to create one standalone workflow from the source data, desired portable-context outputs, and proof requirements in this task.",
668
+ "This is an automated Method-authoring shell generated by Interf.",
669
+ "It exists to create one standalone Method package from the source data, desired portable-context outputs, and proof requirements in this task.",
670
670
  "",
671
671
  "## Start Here",
672
672
  "",
673
673
  "1. Read `runtime/authoring-context.json` now.",
674
- `2. Read \`workflow/README.md\`, \`workflow/workflow.json\`, and \`workflow/${WORKFLOW_SCHEMA_FILE}\` now.`,
675
- "3. Review `artifacts/source-dataset/raw/`.",
676
- "4. Use the local native `interf-workflow-author` skill now.",
674
+ `2. Read \`method/README.md\`, \`method/method.json\`, and \`method/${METHOD_SCHEMA_FILE}\` now.`,
675
+ "3. Review `artifacts/source-folder/raw/`.",
676
+ "4. Use the local native `interf-method-author` skill now.",
677
677
  "",
678
678
  "## Boundaries",
679
679
  "",
680
- `- New workflow id: \`${options.workflowId}\`.`,
680
+ `- New Method package id: \`${options.methodId}\`.`,
681
681
  "- Authoring mode: from scratch.",
682
- ...(options.referenceWorkflowId
683
- ? [`- Reference workflow id: \`${options.referenceWorkflowId}\` (context only, not a seed).`]
682
+ ...(options.referenceMethodId
683
+ ? [`- Reference Method package id: \`${options.referenceMethodId}\` (context only, not a seed).`]
684
684
  : []),
685
- "- Edit only files under `workflow/`.",
685
+ "- Edit only files under `method/`.",
686
686
  "- Do not edit source artifacts.",
687
- "- Keep the workflow valid for the current compiler API and workflow schema.",
687
+ "- Keep the Method package valid for the current compiler API and `method.schema.json`.",
688
+ "- Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
688
689
  "- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
690
+ "- For file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`.",
689
691
  "- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
690
692
  "- Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
691
693
  "",
692
694
  "## Goal",
693
695
  "",
694
- "- produce one standalone workflow tuned to the source data, desired outputs, and checks in this task",
695
- "- replace the neutral scaffold topology with the stage graph this work needs",
696
+ "- produce one standalone Method package tuned to the source data, desired outputs, and checks in this task",
697
+ "- replace the neutral scaffold topology with the stage graph this agent work needs",
696
698
  "- define output zones and stage proof so Interf can show whether the data is ready",
697
699
  "- preserve deterministic stage and context-interface contracts",
698
- "- stop once the workflow edits are complete",
700
+ "- stop once the Method edits are complete",
699
701
  "",
700
702
  ].join("\n");
701
703
  }
702
- function renderWorkflowAuthoringSkill() {
704
+ function renderMethodAuthoringSkill() {
703
705
  return [
704
706
  "---",
705
- "name: interf-workflow-author",
707
+ "name: interf-method-author",
706
708
  "description: >",
707
- " Native local workflow-authoring skill for an automated Interf workflow draft run.",
709
+ " Native local Method-authoring skill for an automated Interf Method draft run.",
708
710
  "---",
709
711
  "",
710
- "# Interf Workflow Authoring",
712
+ "# Interf Method Authoring",
711
713
  "",
712
714
  "Read `runtime/authoring-context.json` first.",
713
- "Then review the neutral workflow scaffold under `workflow/` and the raw snapshot under `artifacts/source-dataset/raw/`.",
715
+ "Then review the neutral Method package scaffold under `method/` and the raw snapshot under `artifacts/source-folder/raw/`.",
714
716
  "",
715
717
  "Rules:",
716
- "- edit only `workflow/`",
717
- `- keep \`workflow.json\`, \`${WORKFLOW_SCHEMA_FILE}\`, and any changed stage docs aligned`,
718
+ "- edit only `method/`",
719
+ `- keep \`method.json\`, \`${METHOD_SCHEMA_FILE}\`, and any changed stage docs aligned`,
718
720
  "- use `zone_counts_at_least` for numeric fixed minimums; use `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`",
721
+ "- for file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`",
719
722
  "- design the stage graph from the source data and preparation-and-evidence brief",
723
+ "- use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids; never use underscores",
720
724
  "- replace the placeholder `prepare` stage unless that exact stage is truly the final method",
721
725
  "- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
722
- "- do not introduce wikilinks unless the workflow also creates the target note by exact basename or explicit relative path",
726
+ "- do not introduce wikilinks unless the Method also creates the target note by exact basename or explicit relative path",
723
727
  "- respect stage boundaries: do not make structure outputs link to notes or entrypoints first created by later stages",
724
728
  "- prefer conservative routing changes over speculative note sprawl",
725
729
  "- prefer direct file-reading and search tools over shell commands for routine file inspection",
726
730
  "- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
727
- "- do not hardcode readiness-check answers into workflow docs",
731
+ "- do not hardcode readiness-check answers into Method docs",
728
732
  "- do not edit source artifacts",
729
733
  "",
730
734
  ].join("\n");
731
735
  }
732
- function improvementWorkflowDocsPath(compiledPath) {
733
- return join(workflowPackagePathForCompiled(compiledPath), "improve");
736
+ function improvementMethodDocsPath(compiledPath) {
737
+ return join(methodPackagePathForCompiled(compiledPath), "improve");
734
738
  }
735
- export function createWorkflowAuthoringShell(options) {
736
- const shellRoot = mkdtempSync(join(tmpdir(), `interf-workflow-author-${options.workflowId}-`));
739
+ export function createMethodAuthoringShell(options) {
740
+ const shellRoot = mkdtempSync(join(tmpdir(), `interf-method-author-${options.methodId}-`));
737
741
  mkdirSync(join(shellRoot, "runtime"), { recursive: true });
738
742
  mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
739
743
  mkdirSync(join(shellRoot, "logs"), { recursive: true });
740
744
  const context = {
741
- kind: "interf-workflow-authoring",
745
+ kind: "interf-method-authoring",
742
746
  version: 1,
743
747
  generated_at: new Date().toISOString(),
744
748
  authoring_mode: "from-scratch",
745
- workflow_id: options.workflowId,
746
- workflow_label: options.label,
747
- ...(options.referenceWorkflowId ? { reference_workflow_id: options.referenceWorkflowId } : {}),
749
+ method_id: options.methodId,
750
+ method_label: options.label,
751
+ ...(options.referenceMethodId ? { reference_method_id: options.referenceMethodId } : {}),
748
752
  task_prompt: options.taskPrompt,
749
- dataset: {
750
- source_path: options.datasetPath,
753
+ preparation: {
754
+ source_folder_path: options.sourceFolderPath,
751
755
  checks: {
752
756
  count: options.checks.length,
753
757
  questions: options.checks.map((check, index) => ({
@@ -759,86 +763,90 @@ export function createWorkflowAuthoringShell(options) {
759
763
  };
760
764
  writeFileSync(join(shellRoot, "runtime", "authoring-context.json"), `${JSON.stringify(context, null, 2)}\n`);
761
765
  projectRawSnapshot({
762
- sourcePath: options.datasetPath,
763
- destinationPath: join(shellRoot, "artifacts", "source-dataset", "raw"),
766
+ sourcePath: options.sourceFolderPath,
767
+ destinationPath: join(shellRoot, "artifacts", "source-folder", "raw"),
764
768
  compiledPath: shellRoot,
765
769
  mode: "copy",
766
770
  prune: true,
767
771
  preserveTimestamps: true,
768
772
  });
769
- linkPath(options.workflowPath, join(shellRoot, "workflow"));
770
- writeNativeAgentSurface(shellRoot, renderWorkflowAuthoringAgents({
771
- workflowId: options.workflowId,
773
+ copyResolvedTree({
774
+ sourcePath: options.methodPath,
775
+ targetPath: join(shellRoot, "method"),
776
+ shellType: "method-authoring",
777
+ });
778
+ writeNativeAgentSurface(shellRoot, renderMethodAuthoringAgents({
779
+ methodId: options.methodId,
772
780
  label: options.label,
773
- referenceWorkflowId: options.referenceWorkflowId ?? null,
774
- }), "interf-workflow-author", renderWorkflowAuthoringSkill());
781
+ referenceMethodId: options.referenceMethodId ?? null,
782
+ }), "interf-method-author", renderMethodAuthoringSkill());
775
783
  return {
776
784
  rootPath: shellRoot,
777
- workflowBeforePath: join(shellRoot, "artifacts", "workflow-before"),
778
- workflowAfterPath: join(shellRoot, "artifacts", "workflow-after"),
779
- promptLogPath: join(shellRoot, "logs", "workflow-author.prompt.txt"),
780
- eventLogPath: join(shellRoot, "logs", "workflow-author.events.ndjson"),
781
- statusLogPath: join(shellRoot, "logs", "workflow-author.status.log"),
785
+ methodBeforePath: join(shellRoot, "artifacts", "method-before"),
786
+ methodAfterPath: join(shellRoot, "artifacts", "method-after"),
787
+ promptLogPath: join(shellRoot, "logs", "method-author.prompt.txt"),
788
+ eventLogPath: join(shellRoot, "logs", "method-author.events.ndjson"),
789
+ statusLogPath: join(shellRoot, "logs", "method-author.status.log"),
782
790
  };
783
791
  }
784
- function renderWorkflowImprovementAgents(compiledName, workflowId, loopIndex) {
792
+ function renderMethodImprovementAgents(compiledName, methodId, loopIndex) {
785
793
  return [
786
- `# ${compiledName} — Workflow Improvement Shell`,
794
+ `# ${compiledName} — Method Improvement Shell`,
787
795
  "",
788
- "This is an automated workflow-improvement shell generated by Interf.",
789
- "It exists to review failed compile/test runs and edit the workflow package for the next variation.",
796
+ "This is an automated Method-improvement shell generated by Interf.",
797
+ "It exists to review failed compile/test runs and edit the Method package for the next variation.",
790
798
  "",
791
799
  "## Start Here",
792
800
  "",
793
801
  "1. Read `runtime/loop-context.json` now.",
794
- `2. Read \`workflow/README.md\`, \`workflow/workflow.json\`, and \`workflow/${WORKFLOW_SCHEMA_FILE}\` now.`,
795
- "3. Read `workflow/improve/SKILL.md` now.",
796
- "4. Use the local native `interf-workflow-improver` skill now.",
802
+ `2. Read \`method/README.md\`, \`method/method.json\`, and \`method/${METHOD_SCHEMA_FILE}\` now.`,
803
+ "3. Read `method/improve/SKILL.md` now.",
804
+ "4. Use the local native `interf-method-improver` skill now.",
797
805
  "",
798
806
  "## Boundaries",
799
807
  "",
800
- `- Workflow: \`${workflowId}\`.`,
808
+ `- Method: \`${methodId}\`.`,
801
809
  `- Improvement loop: ${loopIndex}.`,
802
- "- Edit only files under `workflow/`.",
810
+ "- Edit only files under `method/`.",
803
811
  "- Do not edit checks, test specs, raw files, or generated context outputs.",
804
812
  "- Review context outputs under `artifacts/compiled-view/` and test/runtime evidence under `artifacts/`.",
805
- "- Keep the workflow valid for the current compiler API and workflow schema.",
813
+ "- Keep the Method package valid for the current compiler API and `method.schema.json`.",
806
814
  "- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
807
815
  "",
808
816
  "## Goal",
809
817
  "",
810
- "- create a better workflow variation for this kind of work",
811
- "- preserve deterministic compiled-context structure",
812
- "- stop after the workflow edits are complete",
818
+ "- create a better Method variation for this kind of agent work",
819
+ "- preserve deterministic portable-context structure",
820
+ "- stop after the Method edits are complete",
813
821
  "",
814
822
  ].join("\n");
815
823
  }
816
- function readWorkflowImprovementDoc(compiledPath) {
817
- const path = join(improvementWorkflowDocsPath(compiledPath), "SKILL.md");
824
+ function readMethodImprovementDoc(compiledPath) {
825
+ const path = join(improvementMethodDocsPath(compiledPath), "SKILL.md");
818
826
  if (!existsSync(path))
819
827
  return null;
820
828
  return readFileSync(path, "utf8").trim();
821
829
  }
822
- function renderWorkflowImprovementSkill(workflowId, loopIndex, improvementDoc) {
830
+ function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
823
831
  return [
824
832
  "---",
825
- "name: interf-workflow-improver",
833
+ "name: interf-method-improver",
826
834
  "description: >",
827
- " Native local workflow-improvement skill for this Interf run.",
828
- " Use it only inside an automated workflow-improvement shell.",
835
+ " Native local Method-improvement skill for this Interf run.",
836
+ " Use it only inside an automated Method-improvement shell.",
829
837
  "---",
830
838
  "",
831
- `# Interf Workflow Improvement — ${workflowId}`,
839
+ `# Interf Method Improvement — ${methodId}`,
832
840
  "",
833
- "This local native skill exists for automated workflow-improvement loops.",
841
+ "This local native skill exists for automated Method-improvement loops.",
834
842
  "Read `runtime/loop-context.json` first.",
835
- "Then review the linked workflow package, `artifacts/compiled-view/`, preserved stage shells, runtime logs, and saved test outputs before editing `workflow/`.",
843
+ "Then review the linked Method package, `artifacts/compiled-view/`, preserved stage shells, runtime logs, and saved test outputs before editing `method/`.",
836
844
  "",
837
845
  "## Current Loop",
838
846
  "",
839
- `- workflow: \`${workflowId}\``,
847
+ `- method: \`${methodId}\``,
840
848
  `- loop index: ${loopIndex}`,
841
- "- editable source: `workflow/improve/SKILL.md`",
849
+ "- editable source: `method/improve/SKILL.md`",
842
850
  "",
843
851
  ...(improvementDoc
844
852
  ? [
@@ -862,15 +870,10 @@ function projectCompiledReviewArtifactsSnapshot(compiledPath, shellRoot, schema)
862
870
  copyResolvedTree({
863
871
  sourcePath,
864
872
  targetPath: join(compiledViewRoot, zone.path),
865
- shellType: "workflow-improvement",
873
+ shellType: "method-improvement",
866
874
  });
867
875
  }
868
876
  }
869
- function linkIfExists(targetPath, linkPathname) {
870
- if (!existsSync(targetPath))
871
- return;
872
- linkPath(targetPath, linkPathname);
873
- }
874
877
  function copyIfExists(sourcePath, targetPath, shellType) {
875
878
  if (!existsSync(sourcePath))
876
879
  return;
@@ -894,21 +897,21 @@ function projectCompiledRuntimeArtifacts(compiledPath, shellRoot) {
894
897
  "logs",
895
898
  ];
896
899
  for (const artifactName of artifactNames) {
897
- copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "workflow-improvement");
900
+ copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "method-improvement");
898
901
  }
899
902
  }
900
903
  export function pruneStageExecutionShells(compiledPath) {
901
904
  rmSync(stageExecutionShellsRoot(compiledPath), { recursive: true, force: true });
902
905
  }
903
- export function projectCompiledQueryShell(compiledPath, compiledName, workflowId, about, options) {
904
- const agentsContent = renderCompiledAgents(compiledPath, compiledName, workflowId, about, options);
906
+ export function projectCompiledQueryShell(compiledPath, compiledName, methodId, about, options) {
907
+ const agentsContent = renderCompiledAgents(compiledPath, compiledName, methodId, about, options);
905
908
  const querySkillContent = readCompiledQuerySkillSource(compiledPath);
906
909
  return writeNativeAgentSurface(compiledPath, agentsContent, "interf-query", renderCompiledQueryNativeSkill(querySkillContent));
907
910
  }
908
911
  export function projectRawTestQueryShell(rootPath) {
909
912
  return writeNativeAgentSurface(rootPath, renderRawTestAgents(), "interf-query", renderRawTestQuerySkill());
910
913
  }
911
- export function createStageExecutionShell(compiledPath, compiledName, workflowId, stage, writeArtifacts = []) {
914
+ export function createStageExecutionShell(compiledPath, compiledName, methodId, stage, writeArtifacts = []) {
912
915
  const schema = ensureCompiledExecutionSurface(compiledPath);
913
916
  const materializedZones = stageMaterializedZoneSet(schema, stage, writeArtifacts);
914
917
  const shellsRoot = stageExecutionShellsRoot(compiledPath);
@@ -920,10 +923,10 @@ export function createStageExecutionShell(compiledPath, compiledName, workflowId
920
923
  linkPath(compiledInterfConfigPath(compiledPath), join(shellRoot, "interf.json"));
921
924
  linkPath(join(compiledRuntimeRoot(compiledPath), "stage-contract.json"), shellRuntimePath(shellRoot, "stage-contract.json"));
922
925
  projectCompiledSchemaZones(compiledPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedZones);
923
- projectWorkflowMetadata(compiledPath, shellRoot, stage);
926
+ projectMethodMetadata(compiledPath, shellRoot, stage);
924
927
  projectStageZoneMountAliases(shellRoot, stage, schema);
925
- writeExecutionShellPathsFile(shellRoot, workflowId, stage, buildStageZoneMounts(compiledPath, shellRoot, stage, schema));
926
- const agentsContent = renderStageExecutionAgents(compiledName, workflowId, stage);
928
+ writeExecutionShellPathsFile(shellRoot, methodId, stage, buildStageZoneMounts(compiledPath, shellRoot, stage, schema));
929
+ const agentsContent = renderStageExecutionAgents(compiledName, methodId, stage);
927
930
  writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage, readStageMethodDoc(compiledPath, stage)));
928
931
  return {
929
932
  rootPath: shellRoot,
@@ -932,9 +935,9 @@ export function createStageExecutionShell(compiledPath, compiledName, workflowId
932
935
  export function freezeStageExecutionShell(rootPath) {
933
936
  return freezePreservedShell(rootPath, "stage-execution");
934
937
  }
935
- export function createWorkflowImprovementShell(options) {
938
+ export function createMethodImprovementShell(options) {
936
939
  const schema = ensureCompiledExecutionSurface(options.compiledPath);
937
- const loopRootPath = workflowImprovementLoopRoot(options.compiledPath, options.runId, options.loopIndex);
940
+ const loopRootPath = methodImprovementLoopRoot(options.compiledPath, options.runId, options.loopIndex);
938
941
  const shellRoot = join(loopRootPath, "shell");
939
942
  mkdirSync(shellRoot, { recursive: true });
940
943
  mkdirSync(join(shellRoot, "runtime"), { recursive: true });
@@ -942,34 +945,38 @@ export function createWorkflowImprovementShell(options) {
942
945
  mkdirSync(join(loopRootPath, "logs"), { recursive: true });
943
946
  writeFileSync(join(shellRoot, "runtime", "loop-context.json"), `${JSON.stringify(options.context, null, 2)}\n`);
944
947
  projectCompiledReviewArtifactsSnapshot(options.compiledPath, shellRoot, schema);
945
- linkPath(workflowPackagePathForCompiled(options.compiledPath), join(shellRoot, "workflow"));
946
- copyIfExists(compiledInterfConfigPath(options.compiledPath), join(shellRoot, "interf.json"), "workflow-improvement");
948
+ copyResolvedTree({
949
+ sourcePath: methodPackagePathForCompiled(options.compiledPath),
950
+ targetPath: join(shellRoot, "method"),
951
+ shellType: "method-improvement",
952
+ });
953
+ copyIfExists(compiledInterfConfigPath(options.compiledPath), join(shellRoot, "interf.json"), "method-improvement");
947
954
  projectCompiledRuntimeArtifacts(options.compiledPath, shellRoot);
948
- const reviewSources = resolveWorkflowImprovementReviewSourcePaths(options.compiledPath);
955
+ const reviewSources = resolveMethodImprovementReviewSourcePaths(options.compiledPath);
949
956
  if (reviewSources.executionShells) {
950
- copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "workflow-improvement");
957
+ copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "method-improvement");
951
958
  }
952
959
  if (reviewSources.testComparisons) {
953
- copyIfExists(reviewSources.testComparisons, join(shellRoot, "artifacts", "test-comparisons"), "workflow-improvement");
960
+ copyIfExists(reviewSources.testComparisons, join(shellRoot, "artifacts", "test-comparisons"), "method-improvement");
954
961
  }
955
962
  if (reviewSources.targetTestRuns) {
956
- copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "workflow-improvement");
963
+ copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "method-improvement");
957
964
  }
958
965
  if (reviewSources.targetTestSandboxes) {
959
- copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "workflow-improvement");
966
+ copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "method-improvement");
960
967
  }
961
- const agentsContent = renderWorkflowImprovementAgents(options.compiledName, options.workflowId, options.loopIndex);
962
- writeNativeAgentSurface(shellRoot, agentsContent, "interf-workflow-improver", renderWorkflowImprovementSkill(options.workflowId, options.loopIndex, readWorkflowImprovementDoc(options.compiledPath)));
968
+ const agentsContent = renderMethodImprovementAgents(options.compiledName, options.methodId, options.loopIndex);
969
+ writeNativeAgentSurface(shellRoot, agentsContent, "interf-method-improver", renderMethodImprovementSkill(options.methodId, options.loopIndex, readMethodImprovementDoc(options.compiledPath)));
963
970
  return {
964
971
  rootPath: shellRoot,
965
972
  loopRootPath,
966
- workflowBeforePath: join(loopRootPath, "workflow-before"),
967
- workflowAfterPath: join(loopRootPath, "workflow-after"),
968
- promptLogPath: join(loopRootPath, "logs", "workflow-improver.prompt.txt"),
969
- eventLogPath: join(loopRootPath, "logs", "workflow-improver.events.ndjson"),
970
- statusLogPath: join(loopRootPath, "logs", "workflow-improver.status.log"),
973
+ methodBeforePath: join(loopRootPath, "method-before"),
974
+ methodAfterPath: join(loopRootPath, "method-after"),
975
+ promptLogPath: join(loopRootPath, "logs", "method-improver.prompt.txt"),
976
+ eventLogPath: join(loopRootPath, "logs", "method-improver.events.ndjson"),
977
+ statusLogPath: join(loopRootPath, "logs", "method-improver.status.log"),
971
978
  };
972
979
  }
973
- export function freezeWorkflowImprovementShell(rootPath) {
974
- return freezePreservedShell(rootPath, "workflow-improvement");
980
+ export function freezeMethodImprovementShell(rootPath) {
981
+ return freezePreservedShell(rootPath, "method-improvement");
975
982
  }