@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
@@ -6,7 +6,7 @@ import { parseJsonFrontmatter } from "../shared/parse.js";
6
6
  import { loadRuntimeRun } from "./runtime.js";
7
7
  import { initCompiledState, loadState, refreshCompiledArtifacts, saveState, } from "./state.js";
8
8
  import { compiledInventoryFromEntries } from "./runtime-inventory.js";
9
- import { compiledRuntimeRoot, workflowPackagePathForCompiled } from "./compiled-paths.js";
9
+ import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
10
10
  import { extractSynthAbstract, isOutputMarkdownFile } from "./validate.js";
11
11
  function readActiveRunStartedAtMs(dirPath) {
12
12
  const run = loadRuntimeRun(dirPath);
@@ -93,7 +93,7 @@ function buildInventoryMetadata(options) {
93
93
  return metadata;
94
94
  }
95
95
  function buildStageInventoryEntries(dirPath, stage) {
96
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
96
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
97
97
  if (!schema)
98
98
  return [];
99
99
  const readableInputZones = stage.reads
@@ -155,7 +155,7 @@ export function reconcileCompiledStageRun(dirPath, stage) {
155
155
  const startedAtMs = readActiveRunStartedAtMs(dirPath);
156
156
  if (startedAtMs === null)
157
157
  return false;
158
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
158
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
159
159
  if (!schema)
160
160
  return false;
161
161
  const writeZones = stage.writes
@@ -4,7 +4,7 @@ import chalk from "chalk";
4
4
  import { countFilesRecursive } from "../shared/filesystem.js";
5
5
  import { buildRuntimeExecutorInfo } from "../agents/lib/executors.js";
6
6
  import { RuntimeRunSchema, } from "./lib/schema.js";
7
- import { getWorkflowStageDefinition, getWorkflowStagePosition, getWorkflowStages, } from "../workflow-package/workflow-definitions.js";
7
+ import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "../method-package/method-definitions.js";
8
8
  import { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
9
9
  import { warnInterf } from "../shared/logger.js";
10
10
  export function loadRuntimeRun(dirPath) {
@@ -147,9 +147,9 @@ export function markRuntimeRunSucceededAfterValidation(dirPath, summary) {
147
147
  function startRuntimeRun(options) {
148
148
  const runId = createRunId();
149
149
  const generatedAt = new Date().toISOString();
150
- const workflowStages = getWorkflowStages(options.workflow, options.workflowSourcePath);
151
- const stagePosition = getWorkflowStagePosition(options.workflow, options.stage, options.workflowSourcePath);
152
- const stageDefinition = getWorkflowStageDefinition(options.workflow, options.stage, options.workflowSourcePath);
150
+ const methodStages = getMethodStages(options.method, options.methodSourcePath);
151
+ const stagePosition = getMethodStagePosition(options.method, options.stage, options.methodSourcePath);
152
+ const stageDefinition = getMethodStageDefinition(options.method, options.stage, options.methodSourcePath);
153
153
  const contract = {
154
154
  kind: "interf-stage-contract",
155
155
  version: 1,
@@ -157,11 +157,11 @@ function startRuntimeRun(options) {
157
157
  run_id: runId,
158
158
  target_type: "compiled",
159
159
  target_name: options.compiledName,
160
- workflow: {
161
- id: options.workflow,
160
+ method: {
161
+ id: options.method,
162
162
  stage_index: stagePosition?.stageIndex ?? null,
163
- stage_total: stagePosition?.stageTotal ?? workflowStages.length,
164
- stages: stagePosition?.stages ?? workflowStages,
163
+ stage_total: stagePosition?.stageTotal ?? methodStages.length,
164
+ stages: stagePosition?.stages ?? methodStages,
165
165
  },
166
166
  stage: options.stage,
167
167
  stage_label: stageDefinition?.label ?? options.stageLabel,
@@ -181,7 +181,7 @@ function startRuntimeRun(options) {
181
181
  run_id: runId,
182
182
  target_type: "compiled",
183
183
  target_name: options.compiledName,
184
- workflow: options.workflow,
184
+ method: options.method,
185
185
  stage: options.stage,
186
186
  stage_label: stageDefinition?.label ?? options.stageLabel,
187
187
  contract_type: options.contractType,
@@ -1,14 +1,15 @@
1
- import { type WorkflowExecutor } from "../agents/lib/executors.js";
2
- import { type WorkflowId, type RuntimeContractType, type RuntimeRun, type RuntimeStage, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
1
+ import { type MethodExecutor } from "../agents/lib/executors.js";
2
+ import { type RuntimeRun, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
3
+ import type { MethodId, RuntimeContractType, RuntimeStage } from "../contracts/lib/schema.js";
3
4
  export type RuntimeRunStatus = "running" | "succeeded" | "failed";
4
- export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "workflow" | "stage" | "stage_label" | "contract_type" | "executor">;
5
+ export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "method" | "stage" | "stage_label" | "contract_type" | "executor">;
5
6
  export interface RuntimeStageExecutionOptions {
6
- executor: WorkflowExecutor;
7
+ executor: MethodExecutor;
7
8
  compiledPath: string;
8
9
  executionPath?: string;
9
10
  compiledName: string;
10
- workflow: WorkflowId;
11
- workflowSourcePath?: string;
11
+ method: MethodId;
12
+ methodSourcePath?: string;
12
13
  stage: RuntimeStage;
13
14
  stageLabel: string;
14
15
  contractType: RuntimeContractType;
@@ -35,7 +36,7 @@ export interface RuntimeStageContractOptions {
35
36
  extraReadArtifacts?: string[];
36
37
  stageReadArtifacts: string[];
37
38
  stageWriteArtifacts: string[];
38
- workflowNotes?: string[];
39
+ methodNotes?: string[];
39
40
  localSkillDocs?: string[];
40
41
  instructions: RuntimeStageInstructions;
41
42
  acceptance?: RuntimeStageAcceptance;
@@ -1,22 +1,13 @@
1
- import { basename, join } from "node:path";
2
- import { existsSync } from "node:fs";
1
+ import { basename } from "node:path";
3
2
  import { readInterfConfig, resolveSourceFolderPath, } from "../project-model/interf-detect.js";
4
3
  import { discoverSourceFiles } from "./discovery.js";
5
4
  import { loadRuntimeRun } from "./runtime.js";
6
5
  import { loadState } from "./state-io.js";
7
- import { validateCompiled, validateCompiledStage, validateCompiledWorkflow, } from "./validate.js";
6
+ import { validateCompiled, validateCompiledStage, validateCompiledMethod, } from "./validate.js";
8
7
  import { readCompiledSchemaFile } from "./compiled-schema.js";
9
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
10
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig } from "../workflow-package/workflow-definitions.js";
11
- import { listFilesRecursive } from "../shared/filesystem.js";
12
- function countZoneArtifacts(compiledPath, zonePath, kind) {
13
- const absolutePath = join(compiledPath, zonePath);
14
- if (!existsSync(absolutePath))
15
- return 0;
16
- if (kind === "file")
17
- return 1;
18
- return listFilesRecursive(absolutePath).length;
19
- }
8
+ import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
10
+ import { countCompiledZoneArtifacts } from "./artifact-counts.js";
20
11
  export function computeCompiledHealth(dirPath) {
21
12
  const now = new Date().toISOString();
22
13
  const config = readInterfConfig(dirPath);
@@ -26,38 +17,38 @@ export function computeCompiledHealth(dirPath) {
26
17
  const state = loadState(dirPath);
27
18
  const validation = validateCompiled(dirPath);
28
19
  const activeRun = loadRuntimeRun(dirPath);
29
- const workflowId = config
30
- ? resolveRequiredCompiledWorkflowFromConfig(config, `.interf/interf.json for ${dirPath}`)
20
+ const methodId = config
21
+ ? resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`)
31
22
  : null;
32
- let workflow = null;
33
- if (workflowId) {
23
+ let method = null;
24
+ if (methodId) {
34
25
  try {
35
- workflow = getActiveCompiledWorkflow(dirPath);
26
+ method = getActiveCompiledMethod(dirPath);
36
27
  }
37
28
  catch {
38
- workflow = null;
29
+ method = null;
39
30
  }
40
31
  }
41
- const stageResults = workflow?.stages.map((stage) => ({
32
+ const stageResults = method?.stages.map((stage) => ({
42
33
  stage,
43
34
  validation: validateCompiledStage(dirPath, stage.id),
44
35
  })) ?? [];
45
36
  const completedStages = stageResults.filter((entry) => entry.validation.ok).length;
46
37
  const firstFailed = stageResults.find((entry) => !entry.validation.ok) ?? null;
47
- const workflowValidation = validateCompiledWorkflow(dirPath);
48
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
38
+ const methodValidation = validateCompiledMethod(dirPath);
39
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
49
40
  const zoneMetrics = Object.fromEntries((schema?.zones ?? []).map((zone) => [
50
41
  `zone_${zone.id}`,
51
- countZoneArtifacts(dirPath, zone.path, zone.kind),
42
+ countCompiledZoneArtifacts(dirPath, zone.path, zone.kind),
52
43
  ]));
53
44
  let status = "idle";
54
45
  let stage = "idle";
55
46
  let summary = "Idle — no source files have been compiled yet.";
56
- const errors = workflowValidation.errors.length;
57
- if (!validation.config_present || !validation.config_valid || !validation.config_type_match || !validation.workflow_valid || !validation.schema_valid) {
47
+ const errors = methodValidation.errors.length;
48
+ if (!validation.config_present || !validation.config_valid || !validation.config_type_match || !validation.method_valid || !validation.schema_valid) {
58
49
  status = "failed";
59
50
  stage = "failed";
60
- summary = workflowValidation.summary;
51
+ summary = methodValidation.summary;
61
52
  }
62
53
  else if (activeRun?.status === "running") {
63
54
  status = "running";
@@ -74,22 +65,22 @@ export function computeCompiledHealth(dirPath) {
74
65
  stage = activeRun.stage;
75
66
  summary = activeRun.error ?? activeRun.summary;
76
67
  }
77
- else if (workflowValidation.ok) {
68
+ else if (methodValidation.ok) {
78
69
  status = "compiled";
79
70
  stage = "compiled";
80
- summary = `Compiled — ${completedStages}/${workflow?.stages.length ?? 0} workflow stages satisfied.`;
71
+ summary = `Compiled — ${completedStages}/${method?.stages.length ?? 0} method stages satisfied.`;
81
72
  }
82
73
  else {
83
74
  status = "stale";
84
75
  stage = firstFailed?.stage.id ?? "compiled";
85
- summary = firstFailed?.validation.summary ?? workflowValidation.summary;
76
+ summary = firstFailed?.validation.summary ?? methodValidation.summary;
86
77
  }
87
78
  const checks = {
88
79
  ...validation,
89
- ...(workflow
90
- ? Object.fromEntries(workflow.stages.map((workflowStage) => [
91
- `stage_${workflowStage.id}_ok`,
92
- stageResults.find((entry) => entry.stage.id === workflowStage.id)?.validation.ok ?? false,
80
+ ...(method
81
+ ? Object.fromEntries(method.stages.map((methodStage) => [
82
+ `stage_${methodStage.id}_ok`,
83
+ stageResults.find((entry) => entry.stage.id === methodStage.id)?.validation.ok ?? false,
93
84
  ]))
94
85
  : {}),
95
86
  };
@@ -103,7 +94,7 @@ export function computeCompiledHealth(dirPath) {
103
94
  summary,
104
95
  metrics: {
105
96
  source_total: sourceTotal,
106
- stage_total: workflow?.stages.length ?? 0,
97
+ stage_total: method?.stages.length ?? 0,
107
98
  completed_stages: completedStages,
108
99
  warnings: state?.warning_count ?? 0,
109
100
  errors: (state?.error_count ?? 0) + errors,
@@ -4,9 +4,9 @@ import { discoverSourceFiles } from "./discovery.js";
4
4
  import { readInterfConfig, resolveSourceFolderPath } from "../project-model/interf-detect.js";
5
5
  import { loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
6
6
  import { rawSnapshotPath } from "./state-paths.js";
7
- import { compiledRuntimeRoot, workflowPackagePathForCompiled } from "./compiled-paths.js";
7
+ import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
8
8
  import { readCompiledSchemaFile } from "./compiled-schema.js";
9
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig } from "../workflow-package/workflow-definitions.js";
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
10
10
  export function ensureCompiledViewSpec(dirPath) {
11
11
  const existing = loadCompiledViewSpec(dirPath);
12
12
  const now = new Date().toISOString();
@@ -70,9 +70,9 @@ export function normalizeCompiledViewSpec(existing, defaults) {
70
70
  }
71
71
  function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
72
72
  const config = readInterfConfig(dirPath);
73
- const workflowId = resolveRequiredCompiledWorkflowFromConfig(config, `.interf/interf.json for ${dirPath}`);
74
- const workflow = getActiveCompiledWorkflow(dirPath);
75
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
73
+ resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`);
74
+ const method = getActiveCompiledMethod(dirPath);
75
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
76
76
  const outputDocumentPaths = (schema?.zones ?? [])
77
77
  .filter((zone) => zone.role === "output" && zone.kind !== "runtime")
78
78
  .map((zone) => zone.path);
@@ -97,7 +97,7 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
97
97
  ...(outputDocumentPaths.length > 0
98
98
  ? [{ id: "outputs", type: "documents", title: "Output Zones", paths: outputDocumentPaths }]
99
99
  : []),
100
- { id: "method", type: "documents", title: "Method Docs", paths: ["method/README.md", ...workflow.stages.map((stage) => `method/compile/stages/${stage.skillDir}`)] },
100
+ { id: "method", type: "documents", title: "Method Docs", paths: ["method/README.md", ...method.stages.map((stage) => `method/compile/stages/${stage.skillDir}`)] },
101
101
  ],
102
102
  };
103
103
  }
@@ -2,8 +2,8 @@ export interface CompiledValidationSummary {
2
2
  config_present: boolean;
3
3
  config_valid: boolean;
4
4
  config_type_match: boolean;
5
- workflow_present: boolean;
6
- workflow_valid: boolean;
5
+ method_present: boolean;
6
+ method_valid: boolean;
7
7
  schema_present: boolean;
8
8
  schema_valid: boolean;
9
9
  }
@@ -16,12 +16,12 @@ export interface CompiledStageValidation {
16
16
  checks: Record<string, boolean>;
17
17
  errors: string[];
18
18
  }
19
- export interface CompiledWorkflowValidation extends CompiledStageValidation {
19
+ export interface CompiledMethodValidation extends CompiledStageValidation {
20
20
  stage_results: Record<string, boolean>;
21
21
  }
22
22
  export declare function validateCompiled(dirPath: string): CompiledValidationSummary;
23
23
  export declare function validateCompiledStage(dirPath: string, stageId: string): CompiledStageValidation;
24
- export declare function validateCompiledWorkflow(dirPath: string): CompiledWorkflowValidation;
24
+ export declare function validateCompiledMethod(dirPath: string): CompiledMethodValidation;
25
25
  export declare function validateCompiledSummarize(dirPath: string): CompiledStageValidation;
26
26
  export declare function validateCompiledStructure(dirPath: string): CompiledStageValidation;
27
- export declare function validateCompiledCompile(dirPath: string): CompiledWorkflowValidation;
27
+ export declare function validateCompiledCompile(dirPath: string): CompiledMethodValidation;
@@ -1,53 +1,45 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { discoverSourceFiles } from "./discovery.js";
3
- import { WORKFLOW_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, workflowSchemaExists, } from "./compiled-schema.js";
3
+ import { METHOD_SCHEMA_FILE, findCompiledSchemaZone, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
4
4
  import { resolveSourceFolderPath } from "../project-model/interf-detect.js";
5
- import { compiledInterfConfigPath, workflowPackagePathForCompiled } from "./compiled-paths.js";
5
+ import { compiledInterfConfigPath, methodPackagePathForCompiled } from "./compiled-paths.js";
6
6
  import { readCompiledConfig } from "./validate.js";
7
7
  import { loadState } from "./state.js";
8
8
  import { validateResolvedStageAcceptance, stageRecordFromState } from "./runtime-acceptance.js";
9
- import { getActiveCompiledWorkflow, resolveRequiredCompiledWorkflowFromConfig, } from "../workflow-package/workflow-definitions.js";
10
- import { listFilesRecursive } from "../shared/filesystem.js";
11
- function workflowSchemaPresent(dirPath) {
12
- return workflowSchemaExists(workflowPackagePathForCompiled(dirPath));
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../method-package/method-definitions.js";
10
+ import { countCompiledZoneArtifacts } from "./artifact-counts.js";
11
+ function methodSchemaPresent(dirPath) {
12
+ return methodSchemaExists(methodPackagePathForCompiled(dirPath));
13
13
  }
14
- function workflowJsonPresent(dirPath) {
15
- return existsSync(workflowPackagePathForCompiled(dirPath) + "/workflow.json");
14
+ function methodJsonPresent(dirPath) {
15
+ return existsSync(methodPackagePathForCompiled(dirPath) + "/method.json");
16
16
  }
17
- function countZoneArtifacts(compiledPath, zonePath, kind) {
18
- const absolutePath = compiledZoneAbsolutePath(compiledPath, { path: zonePath });
19
- if (!existsSync(absolutePath))
20
- return 0;
21
- if (kind === "file")
22
- return 1;
23
- return listFilesRecursive(absolutePath).length;
24
- }
25
- function readWorkflowContext(dirPath) {
17
+ function readMethodContext(dirPath) {
26
18
  const config = readCompiledConfig(dirPath);
27
- const workflowId = config.valid
28
- ? resolveRequiredCompiledWorkflowFromConfig(config.value, `.interf/interf.json for ${dirPath}`)
19
+ const methodId = config.valid
20
+ ? resolveRequiredCompiledMethodFromConfig(config.value, `.interf/interf.json for ${dirPath}`)
29
21
  : null;
30
- let workflow = null;
31
- if (workflowId) {
22
+ let method = null;
23
+ if (methodId) {
32
24
  try {
33
- workflow = getActiveCompiledWorkflow(dirPath);
25
+ method = getActiveCompiledMethod(dirPath);
34
26
  }
35
27
  catch {
36
- workflow = null;
28
+ method = null;
37
29
  }
38
30
  }
39
- const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(dirPath));
31
+ const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
40
32
  const state = loadState(dirPath);
41
33
  const sourceTotal = config.valid
42
34
  ? discoverSourceFiles(resolveSourceFolderPath(dirPath, config.value), dirPath).totalCount
43
35
  : 0;
44
36
  return {
45
37
  config,
46
- workflow,
38
+ method,
47
39
  schema,
48
40
  state,
49
41
  sourceTotal,
50
- workflowId,
42
+ methodId,
51
43
  };
52
44
  }
53
45
  function stageRequired(sourceTotal, writeCounts, stageRecordPresent) {
@@ -60,7 +52,7 @@ function zoneWriteCount(compiledPath, schema, stage) {
60
52
  const zone = findCompiledSchemaZone(schema, zoneId);
61
53
  if (!zone)
62
54
  continue;
63
- const count = countZoneArtifacts(compiledPath, zone.path, zone.kind);
55
+ const count = countCompiledZoneArtifacts(compiledPath, zone.path, zone.kind);
64
56
  zoneCounts[zoneId] = count;
65
57
  total += count;
66
58
  }
@@ -82,26 +74,26 @@ function mergeValidationCounts(sourceTotal, stageRecord, zoneCounts) {
82
74
  return merged;
83
75
  }
84
76
  export function validateCompiled(dirPath) {
85
- const context = readWorkflowContext(dirPath);
77
+ const context = readMethodContext(dirPath);
86
78
  return {
87
79
  config_present: context.config.present,
88
80
  config_valid: context.config.valid,
89
81
  config_type_match: context.config.typeMatch(),
90
- workflow_present: workflowJsonPresent(dirPath),
91
- workflow_valid: context.workflow !== null,
92
- schema_present: workflowSchemaPresent(dirPath),
82
+ method_present: methodJsonPresent(dirPath),
83
+ method_valid: context.method !== null,
84
+ schema_present: methodSchemaPresent(dirPath),
93
85
  schema_valid: context.schema !== null,
94
86
  };
95
87
  }
96
88
  export function validateCompiledStage(dirPath, stageId) {
97
- const context = readWorkflowContext(dirPath);
89
+ const context = readMethodContext(dirPath);
98
90
  const checks = {
99
91
  config_present: context.config.present,
100
92
  config_valid: context.config.valid,
101
93
  config_type_match: context.config.typeMatch(),
102
- workflow_present: workflowJsonPresent(dirPath),
103
- workflow_valid: context.workflow !== null,
104
- schema_present: workflowSchemaPresent(dirPath),
94
+ method_present: methodJsonPresent(dirPath),
95
+ method_valid: context.method !== null,
96
+ schema_present: methodSchemaPresent(dirPath),
105
97
  schema_valid: context.schema !== null,
106
98
  };
107
99
  const errors = [];
@@ -110,34 +102,34 @@ export function validateCompiledStage(dirPath, stageId) {
110
102
  else if (!checks.config_valid)
111
103
  errors.push(`Could not parse ${compiledInterfConfigPath(dirPath)}.`);
112
104
  else if (!checks.config_type_match)
113
- errors.push("Config is not a compiled context.");
114
- if (!checks.workflow_present)
115
- errors.push("Missing .interf/method/workflow.json.");
116
- else if (!checks.workflow_valid)
117
- errors.push("Could not load the active workflow package.");
105
+ errors.push("Config is not a portable context.");
106
+ if (!checks.method_present)
107
+ errors.push("Missing .interf/method/method.json.");
108
+ else if (!checks.method_valid)
109
+ errors.push("Could not load the active Method package.");
118
110
  if (!checks.schema_present)
119
- errors.push(`Missing .interf/method/${WORKFLOW_SCHEMA_FILE}.`);
111
+ errors.push(`Missing .interf/method/${METHOD_SCHEMA_FILE}.`);
120
112
  else if (!checks.schema_valid)
121
- errors.push(`Could not parse .interf/method/${WORKFLOW_SCHEMA_FILE}.`);
122
- const workflowStage = context.workflow?.stages.find((stage) => stage.id === stageId) ?? null;
123
- checks.stage_present = workflowStage !== null;
113
+ errors.push(`Could not parse .interf/method/${METHOD_SCHEMA_FILE}.`);
114
+ const methodStage = context.method?.stages.find((stage) => stage.id === stageId) ?? null;
115
+ checks.stage_present = methodStage !== null;
124
116
  if (!checks.stage_present) {
125
- errors.push(`Workflow does not declare stage "${stageId}".`);
117
+ errors.push(`Method does not declare stage "${stageId}".`);
126
118
  }
127
119
  const stageRecord = stageRecordFromState(context.state, stageId);
128
120
  checks.stage_record_present = stageRecord !== null;
129
121
  checks.stage_finished = Boolean(stageRecord?.finished_at);
130
122
  checks.stage_succeeded = stageRecord?.status === "succeeded";
131
- const writeCounts = workflowStage && context.schema
132
- ? zoneWriteCount(dirPath, context.schema, workflowStage)
123
+ const writeCounts = methodStage && context.schema
124
+ ? zoneWriteCount(dirPath, context.schema, methodStage)
133
125
  : { total: 0, zoneCounts: {} };
134
126
  const acceptanceCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.zoneCounts);
135
127
  const required = stageRequired(context.sourceTotal, writeCounts.total, checks.stage_record_present);
136
128
  let acceptanceErrors = [];
137
- if (workflowStage && context.schema) {
129
+ if (methodStage && context.schema) {
138
130
  const acceptanceValidation = validateResolvedStageAcceptance(dirPath, {
139
131
  stageId,
140
- acceptance: workflowStage.acceptance,
132
+ acceptance: methodStage.acceptance,
141
133
  counts: acceptanceCounts,
142
134
  });
143
135
  checks.acceptance_ok = acceptanceValidation.ok;
@@ -169,30 +161,30 @@ export function validateCompiledStage(dirPath, stageId) {
169
161
  counts: {
170
162
  ...acceptanceCounts,
171
163
  write_artifacts: writeCounts.total,
172
- declared_write_zones: workflowStage?.writes.length ?? 0,
164
+ declared_write_zones: methodStage?.writes.length ?? 0,
173
165
  },
174
166
  checks,
175
167
  errors,
176
168
  };
177
169
  }
178
- export function validateCompiledWorkflow(dirPath) {
179
- const context = readWorkflowContext(dirPath);
170
+ export function validateCompiledMethod(dirPath) {
171
+ const context = readMethodContext(dirPath);
180
172
  const checks = {
181
173
  config_present: context.config.present,
182
174
  config_valid: context.config.valid,
183
175
  config_type_match: context.config.typeMatch(),
184
- workflow_present: workflowJsonPresent(dirPath),
185
- workflow_valid: context.workflow !== null,
186
- schema_present: workflowSchemaPresent(dirPath),
176
+ method_present: methodJsonPresent(dirPath),
177
+ method_valid: context.method !== null,
178
+ schema_present: methodSchemaPresent(dirPath),
187
179
  schema_valid: context.schema !== null,
188
180
  };
189
- if (!context.workflow) {
190
- const errors = ["Could not load the active workflow package."];
181
+ if (!context.method) {
182
+ const errors = ["Could not load the active Method package."];
191
183
  return {
192
184
  ok: false,
193
185
  required: true,
194
- stage: "workflow",
195
- summary: `Compiled workflow failed — ${errors[0]}`,
186
+ stage: "method",
187
+ summary: `Compiled Method failed — ${errors[0]}`,
196
188
  counts: { source_total: context.sourceTotal, stage_total: 0, completed_stages: 0 },
197
189
  checks,
198
190
  errors,
@@ -203,7 +195,7 @@ export function validateCompiledWorkflow(dirPath) {
203
195
  const errors = [];
204
196
  let completedStages = 0;
205
197
  let failedStage = "compiled";
206
- for (const stage of context.workflow.stages) {
198
+ for (const stage of context.method.stages) {
207
199
  const validation = validateCompiledStage(dirPath, stage.id);
208
200
  stageResults[stage.id] = validation.ok;
209
201
  if (validation.ok) {
@@ -220,11 +212,11 @@ export function validateCompiledWorkflow(dirPath) {
220
212
  required: context.sourceTotal > 0,
221
213
  stage: failedStage,
222
214
  summary: ok
223
- ? `Compiled workflow verified — ${completedStages}/${context.workflow.stages.length} stages satisfied.`
224
- : `Compiled workflow failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
215
+ ? `Compiled Method verified — ${completedStages}/${context.method.stages.length} stages satisfied.`
216
+ : `Compiled Method failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
225
217
  counts: {
226
218
  source_total: context.sourceTotal,
227
- stage_total: context.workflow.stages.length,
219
+ stage_total: context.method.stages.length,
228
220
  completed_stages: completedStages,
229
221
  },
230
222
  checks,
@@ -239,5 +231,5 @@ export function validateCompiledStructure(dirPath) {
239
231
  return validateCompiledStage(dirPath, "structure");
240
232
  }
241
233
  export function validateCompiledCompile(dirPath) {
242
- return validateCompiledWorkflow(dirPath);
234
+ return validateCompiledMethod(dirPath);
243
235
  }
@@ -17,5 +17,5 @@ export declare function isOutputMarkdownFile(filePath: string): boolean;
17
17
  export declare function safeReadText(filePath: string): string | null;
18
18
  export declare function extractSynthAbstract(frontmatter: Record<string, unknown>, body: string): string | null;
19
19
  export declare function countSynthAbstractWords(frontmatter: Record<string, unknown>, body: string): number;
20
- export { validateCompiled, validateCompiledStage, validateCompiledWorkflow, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
21
- export type { CompiledValidationSummary, CompiledStageValidation, CompiledWorkflowValidation, } from "./validate-compiled.js";
20
+ export { validateCompiled, validateCompiledStage, validateCompiledMethod, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
21
+ export type { CompiledValidationSummary, CompiledStageValidation, CompiledMethodValidation, } from "./validate-compiled.js";
@@ -1,8 +1,8 @@
1
1
  import { existsSync, readFileSync, statSync, } from "node:fs";
2
- import { basename, extname, join } from "node:path";
2
+ import { basename, dirname, extname, join, resolve } from "node:path";
3
3
  import { readCompiledSchemaFile } from "./compiled-schema.js";
4
4
  import { compiledKnowledgeRootPath } from "./compiled-schema.js";
5
- import { workflowPackagePathForCompiled } from "./compiled-paths.js";
5
+ import { methodPackagePathForCompiled } from "./compiled-paths.js";
6
6
  import { listFilesRecursive } from "../shared/filesystem.js";
7
7
  import { readInterfConfig } from "../project-model/interf-detect.js";
8
8
  import { parseJsonFrontmatter } from "../shared/parse.js";
@@ -75,15 +75,15 @@ export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots
75
75
  if (!target)
76
76
  continue;
77
77
  if (target.includes("/")) {
78
- if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes)) {
78
+ if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath)) {
79
79
  brokenLinks += 1;
80
80
  }
81
81
  continue;
82
82
  }
83
83
  if (!noteIndex.has(target.toLowerCase()) &&
84
84
  !noteIndex.has(noteName(target).toLowerCase()) &&
85
- !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) &&
86
- !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes)) {
85
+ !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath) &&
86
+ !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes, filePath)) {
87
87
  brokenLinks += 1;
88
88
  }
89
89
  }
@@ -172,13 +172,16 @@ function countWords(text) {
172
172
  function noteName(filePath) {
173
173
  return basename(filePath, extname(filePath));
174
174
  }
175
- function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) {
176
- return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes)
175
+ function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
176
+ return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath)
177
177
  .some((candidate) => existsSync(candidate));
178
178
  }
179
- function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes) {
179
+ function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
180
180
  const candidates = new Set();
181
181
  addPathCandidate(candidates, join(compiledRoot, target));
182
+ if (sourceFilePath && (target.startsWith("./") || target.startsWith("../"))) {
183
+ addPathCandidateIfInside(candidates, compiledRoot, resolve(dirname(sourceFilePath), target));
184
+ }
182
185
  const [firstSegment] = target.split("/");
183
186
  if (firstSegment && knowledgeRelativePrefixes.has(firstSegment)) {
184
187
  addPathCandidate(candidates, join(compiledKnowledgeRootPath(compiledRoot), target));
@@ -194,13 +197,18 @@ function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativ
194
197
  }
195
198
  function addPathCandidate(candidates, absolutePath) {
196
199
  candidates.add(absolutePath);
197
- if (!absolutePath.endsWith(".md")) {
198
- candidates.add(`${absolutePath}.md`);
199
- }
200
+ candidates.add(`${absolutePath}.md`);
201
+ }
202
+ function addPathCandidateIfInside(candidates, compiledRoot, absolutePath) {
203
+ const root = resolve(compiledRoot);
204
+ const candidate = resolve(absolutePath);
205
+ if (candidate !== root && !candidate.startsWith(`${root}/`))
206
+ return;
207
+ addPathCandidate(candidates, candidate);
200
208
  }
201
209
  function compiledZoneDirectoryPaths(compiledRoot) {
202
- const workflowRoot = workflowPackagePathForCompiled(compiledRoot);
203
- const schema = readCompiledSchemaFile(workflowRoot);
210
+ const methodRoot = methodPackagePathForCompiled(compiledRoot);
211
+ const schema = readCompiledSchemaFile(methodRoot);
204
212
  if (!schema)
205
213
  return new Map();
206
214
  return new Map(schema.zones
@@ -246,4 +254,4 @@ function addFrontmatterLinkTarget(targets, value) {
246
254
  }
247
255
  }
248
256
  }
249
- export { validateCompiled, validateCompiledStage, validateCompiledWorkflow, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
257
+ export { validateCompiled, validateCompiledStage, validateCompiledMethod, validateCompiledSummarize, validateCompiledStructure, validateCompiledCompile, } from "./validate-compiled.js";
@@ -0,0 +1,2 @@
1
+ export * as schema from "./lib/schema.js";
2
+ export type { MethodId, PreparationName, ReadinessCheck, ReadinessGate, ReadinessState, ReadinessStatus, ReadinessTargetResult, RuntimeContractType, RuntimeExecutorInfo, RuntimeStage, RuntimeTargetType, TestCaseExpect, TestTargetType, } from "./lib/schema.js";
@@ -0,0 +1 @@
1
+ export * as schema from "./lib/schema.js";