@interf/compiler 0.9.5 → 0.16.0

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 (365) hide show
  1. package/README.md +135 -91
  2. package/TRADEMARKS.md +2 -13
  3. package/agent-skills/interf-actions/SKILL.md +143 -38
  4. package/agent-skills/interf-actions/references/cli.md +134 -67
  5. package/builtin-methods/interf-default/README.md +3 -4
  6. package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
  7. package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +1 -1
  9. package/builtin-methods/interf-default/method.json +10 -4
  10. package/builtin-methods/interf-default/method.schema.json +0 -9
  11. package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
  12. package/dist/cli/commands/agents.d.ts +2 -0
  13. package/dist/cli/commands/agents.js +213 -0
  14. package/dist/cli/commands/compile.d.ts +8 -25
  15. package/dist/cli/commands/compile.js +83 -359
  16. package/dist/cli/commands/doctor.js +2 -2
  17. package/dist/cli/commands/login.d.ts +7 -0
  18. package/dist/cli/commands/login.js +39 -0
  19. package/dist/cli/commands/logout.d.ts +2 -0
  20. package/dist/cli/commands/logout.js +16 -0
  21. package/dist/cli/commands/mcp.d.ts +42 -0
  22. package/dist/cli/commands/mcp.js +239 -0
  23. package/dist/cli/commands/method.d.ts +2 -0
  24. package/dist/cli/commands/method.js +113 -0
  25. package/dist/cli/commands/prep.d.ts +2 -0
  26. package/dist/cli/commands/prep.js +152 -0
  27. package/dist/cli/commands/reset.d.ts +8 -1
  28. package/dist/cli/commands/reset.js +47 -26
  29. package/dist/cli/commands/runs.d.ts +2 -0
  30. package/dist/cli/commands/runs.js +120 -0
  31. package/dist/cli/commands/status.d.ts +6 -1
  32. package/dist/cli/commands/status.js +68 -111
  33. package/dist/cli/commands/verify.d.ts +7 -1
  34. package/dist/cli/commands/verify.js +69 -85
  35. package/dist/cli/commands/web.d.ts +0 -9
  36. package/dist/cli/commands/web.js +201 -121
  37. package/dist/cli/commands/wizard.d.ts +9 -0
  38. package/dist/cli/commands/wizard.js +689 -0
  39. package/dist/cli/index.d.ts +10 -7
  40. package/dist/cli/index.js +19 -12
  41. package/dist/compiler-ui/404.html +1 -1
  42. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  43. package/dist/compiler-ui/__next._full.txt +3 -3
  44. package/dist/compiler-ui/__next._head.txt +1 -1
  45. package/dist/compiler-ui/__next._index.txt +2 -2
  46. package/dist/compiler-ui/__next._tree.txt +2 -2
  47. package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
  48. package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
  49. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  50. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  51. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  52. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  53. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  54. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  55. package/dist/compiler-ui/_not-found.html +1 -1
  56. package/dist/compiler-ui/_not-found.txt +2 -2
  57. package/dist/compiler-ui/index.html +1 -1
  58. package/dist/compiler-ui/index.txt +3 -3
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.js +2 -2
  61. package/dist/packages/contracts/index.d.ts +2 -1
  62. package/dist/packages/contracts/index.js +1 -0
  63. package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
  64. package/dist/packages/contracts/lib/preparation-paths.js +177 -0
  65. package/dist/packages/contracts/lib/schema.d.ts +187 -13
  66. package/dist/packages/contracts/lib/schema.js +148 -3
  67. package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
  68. package/dist/packages/contracts/utils/filesystem.js +142 -0
  69. package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
  70. package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
  71. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  72. package/dist/packages/{local-service → engine}/action-planner.js +3 -2
  73. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  74. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  75. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  76. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  77. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  78. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  79. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +5 -5
  80. package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
  81. package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
  82. package/dist/packages/engine/agents/lib/user-config.js +24 -0
  83. package/dist/packages/engine/agents/registry.d.ts +91 -0
  84. package/dist/packages/engine/agents/registry.js +321 -0
  85. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  86. package/dist/packages/engine/agents/role-executors.js +88 -0
  87. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  88. package/dist/packages/engine/agents/role-router.js +73 -0
  89. package/dist/packages/{local-service → engine}/client.d.ts +59 -60
  90. package/dist/packages/{local-service → engine}/client.js +137 -145
  91. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
  92. package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
  93. package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
  94. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  95. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
  96. package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
  97. package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
  98. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
  99. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
  100. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  101. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
  102. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
  103. package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
  104. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  105. package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
  106. package/dist/packages/{compiler → engine/compile}/index.js +1 -0
  107. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
  108. package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
  109. package/dist/packages/engine/compile/method-runs.d.ts +14 -0
  110. package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
  111. package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
  112. package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
  113. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
  114. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
  115. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  116. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
  117. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  118. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
  119. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
  120. package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
  121. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
  122. package/dist/packages/engine/compile/source-files.d.ts +46 -0
  123. package/dist/packages/engine/compile/source-files.js +149 -0
  124. package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
  125. package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
  126. package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
  127. package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
  128. package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
  129. package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
  130. package/dist/packages/engine/compile/state-paths.js +16 -0
  131. package/dist/packages/engine/compile/state-view.d.ts +5 -0
  132. package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
  133. package/dist/packages/engine/compile/state.d.ts +7 -0
  134. package/dist/packages/{compiler → engine/compile}/state.js +3 -3
  135. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
  136. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  137. package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
  138. package/dist/packages/engine/connection-config.d.ts +38 -0
  139. package/dist/packages/engine/connection-config.js +75 -0
  140. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
  141. package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
  142. package/dist/packages/engine/index.d.ts +22 -0
  143. package/dist/packages/engine/index.js +15 -0
  144. package/dist/packages/engine/instance-paths.d.ts +100 -0
  145. package/dist/packages/engine/instance-paths.js +165 -0
  146. package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
  147. package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
  148. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  149. package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
  150. package/dist/packages/engine/preparation-store.d.ts +104 -0
  151. package/dist/packages/engine/preparation-store.js +194 -0
  152. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  153. package/dist/packages/engine/routes.d.ts +78 -0
  154. package/dist/packages/engine/routes.js +92 -0
  155. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  156. package/dist/packages/{local-service → engine}/run-observability.js +25 -24
  157. package/dist/packages/engine/runtime-caches.d.ts +76 -0
  158. package/dist/packages/engine/runtime-caches.js +191 -0
  159. package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
  160. package/dist/packages/engine/runtime-event-applier.js +177 -0
  161. package/dist/packages/engine/runtime-persistence.d.ts +47 -0
  162. package/dist/packages/engine/runtime-persistence.js +137 -0
  163. package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
  164. package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
  165. package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
  166. package/dist/packages/engine/runtime-resource-builders.js +149 -0
  167. package/dist/packages/engine/runtime.d.ts +318 -0
  168. package/dist/packages/{local-service → engine}/runtime.js +835 -1011
  169. package/dist/packages/{local-service → engine}/server.d.ts +15 -0
  170. package/dist/packages/engine/server.js +1257 -0
  171. package/dist/packages/engine/service-registry.d.ts +47 -0
  172. package/dist/packages/engine/service-registry.js +137 -0
  173. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
  174. package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
  175. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
  176. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
  177. package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
  178. package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
  179. package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
  180. package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
  181. package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
  182. package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
  183. package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
  184. package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
  185. package/dist/packages/{testing → engine/verify}/test.js +1 -1
  186. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
  187. package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
  188. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  189. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  190. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  191. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +4 -5
  192. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
  193. package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
  194. package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
  195. package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
  196. package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
  197. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  198. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
  199. package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
  200. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
  201. package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
  202. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
  203. package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
  204. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  205. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  206. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  207. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +3 -31
  208. package/dist/packages/methods/package/user-methods.d.ts +17 -0
  209. package/dist/packages/methods/package/user-methods.js +77 -0
  210. package/dist/packages/{project-model → project}/index.d.ts +0 -1
  211. package/dist/packages/{project-model → project}/index.js +0 -1
  212. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  213. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  214. package/dist/packages/{project-model → project}/interf-detect.d.ts +8 -3
  215. package/dist/packages/{project-model → project}/interf-detect.js +38 -38
  216. package/dist/packages/project/interf-scaffold.d.ts +3 -0
  217. package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
  218. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  219. package/dist/packages/{project-model → project}/lib/schema.js +39 -2
  220. package/dist/packages/project/preparation-entries.d.ts +11 -0
  221. package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
  222. package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
  223. package/dist/packages/{project-model → project}/source-config.js +81 -53
  224. package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
  225. package/dist/packages/{project-model → project}/source-folders.js +16 -16
  226. package/package.json +8 -8
  227. package/CHANGELOG.md +0 -93
  228. package/LICENSE +0 -183
  229. package/dist/cli/commands/action-input-cli.d.ts +0 -25
  230. package/dist/cli/commands/action-input-cli.js +0 -73
  231. package/dist/cli/commands/control-path.d.ts +0 -11
  232. package/dist/cli/commands/control-path.js +0 -72
  233. package/dist/cli/commands/create-method-wizard.d.ts +0 -64
  234. package/dist/cli/commands/create-method-wizard.js +0 -434
  235. package/dist/cli/commands/create.d.ts +0 -6
  236. package/dist/cli/commands/create.js +0 -183
  237. package/dist/cli/commands/default.d.ts +0 -2
  238. package/dist/cli/commands/default.js +0 -39
  239. package/dist/cli/commands/executor-flow.d.ts +0 -29
  240. package/dist/cli/commands/executor-flow.js +0 -163
  241. package/dist/cli/commands/init.d.ts +0 -26
  242. package/dist/cli/commands/init.js +0 -771
  243. package/dist/cli/commands/list.d.ts +0 -2
  244. package/dist/cli/commands/list.js +0 -30
  245. package/dist/cli/commands/preparation-action.d.ts +0 -8
  246. package/dist/cli/commands/preparation-action.js +0 -29
  247. package/dist/cli/commands/preparation-picker.d.ts +0 -5
  248. package/dist/cli/commands/preparation-picker.js +0 -36
  249. package/dist/cli/commands/preparation-selection.d.ts +0 -6
  250. package/dist/cli/commands/preparation-selection.js +0 -11
  251. package/dist/cli/commands/service-action-flow.d.ts +0 -9
  252. package/dist/cli/commands/service-action-flow.js +0 -19
  253. package/dist/cli/commands/source-config-wizard.d.ts +0 -51
  254. package/dist/cli/commands/source-config-wizard.js +0 -670
  255. package/dist/cli/commands/test.d.ts +0 -17
  256. package/dist/cli/commands/test.js +0 -188
  257. package/dist/packages/agents/lib/detection.d.ts +0 -7
  258. package/dist/packages/agents/lib/user-config.js +0 -16
  259. package/dist/packages/compiler/method-runs.d.ts +0 -15
  260. package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
  261. package/dist/packages/compiler/raw-snapshot.js +0 -101
  262. package/dist/packages/compiler/state-artifacts.d.ts +0 -8
  263. package/dist/packages/compiler/state-paths.js +0 -13
  264. package/dist/packages/compiler/state-view.d.ts +0 -4
  265. package/dist/packages/compiler/state.d.ts +0 -7
  266. package/dist/packages/local-service/index.d.ts +0 -18
  267. package/dist/packages/local-service/index.js +0 -13
  268. package/dist/packages/local-service/routes.d.ts +0 -32
  269. package/dist/packages/local-service/routes.js +0 -37
  270. package/dist/packages/local-service/runtime.d.ts +0 -133
  271. package/dist/packages/local-service/server.js +0 -627
  272. package/dist/packages/method-package/index.d.ts +0 -11
  273. package/dist/packages/method-package/index.js +0 -11
  274. package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
  275. package/dist/packages/method-package/method-stage-policy.js +0 -31
  276. package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
  277. package/dist/packages/project-model/preparation-entries.d.ts +0 -11
  278. package/dist/packages/project-model/project-paths.d.ts +0 -12
  279. package/dist/packages/project-model/project-paths.js +0 -33
  280. package/dist/packages/shared/filesystem.d.ts +0 -2
  281. package/dist/packages/shared/filesystem.js +0 -55
  282. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
  283. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
  284. /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
  285. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  286. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  287. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  288. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  289. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  290. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  291. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  292. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  293. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  294. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  295. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  296. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  297. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  298. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  299. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  300. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  301. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  302. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  303. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  304. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  305. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  306. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  307. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  308. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  309. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  310. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  311. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  312. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  313. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  314. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  315. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  316. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  317. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  318. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  319. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  320. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  321. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  322. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  323. /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
  324. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  325. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  326. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  327. /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
  328. /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
  329. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  330. /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
  331. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  332. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  333. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  334. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  335. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  336. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  337. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  338. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  339. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  340. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  341. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  342. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  343. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  344. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  345. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  346. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  347. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  348. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  349. /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
  350. /package/dist/packages/{testing → engine/verify}/index.js +0 -0
  351. /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
  352. /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
  353. /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
  354. /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
  355. /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
  356. /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
  357. /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
  358. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  359. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  360. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  361. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  362. /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
  363. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  364. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  365. /package/dist/packages/{project-model → project}/interf.js +0 -0
@@ -1,10 +1,11 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { basename, dirname, join } from "node:path";
3
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compiler/compiled-paths.js";
3
+ import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compile/compiled-paths.js";
4
+ import { asPreparationDataDir, preparationTestsSpecsRoot, } from "../../contracts/lib/preparation-paths.js";
4
5
  const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
5
6
  export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
6
7
  export function testSpecRootPath(sourcePath) {
7
- return join(sourcePath, "interf", "tests", "specs");
8
+ return preparationTestsSpecsRoot(asPreparationDataDir(sourcePath));
8
9
  }
9
10
  export function testSpecTypePath(sourcePath, type) {
10
11
  return join(testSpecRootPath(sourcePath), type);
@@ -18,7 +19,7 @@ export function targetTestRunsPath(compiledPath, type) {
18
19
  return join(targetTestRunsRootForCompiled(compiledPath), type);
19
20
  }
20
21
  if (isPreparationTestsRootPath(compiledPath)) {
21
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "runs");
22
+ return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "runs");
22
23
  }
23
24
  throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
24
25
  }
@@ -30,7 +31,7 @@ export function targetTestSandboxesPath(compiledPath, type) {
30
31
  return join(targetTestSandboxesRootForCompiled(compiledPath), type);
31
32
  }
32
33
  if (isPreparationTestsRootPath(compiledPath)) {
33
- return join(compiledPath, type === "raw" ? "file-as-is" : "compiled", "sandboxes");
34
+ return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "sandboxes");
34
35
  }
35
36
  throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
36
37
  }
@@ -2,7 +2,6 @@ import type { TestTargetCandidate } from "./test-types.js";
2
2
  export type TestSandboxRetentionMode = "on-failure" | "always";
3
3
  export interface TestSandbox {
4
4
  rootPath: string;
5
- rawPath: string;
6
5
  targetPath: string;
7
6
  compiledPath: string | null;
8
7
  preserve(destinationPath: string): string;
@@ -1,17 +1,14 @@
1
- import { cpSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, } from "node:fs";
1
+ import { cpSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync, } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
- import { dirname, join, relative, sep } from "node:path";
3
+ import { dirname, join } from "node:path";
4
4
  import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
5
- import { readInterfConfig } from "../project-model/interf.js";
6
- import { projectRawTestQueryShell } from "../agents/lib/shells.js";
7
- import { portableContextPath } from "../project-model/project-paths.js";
8
- import { saveCompiledInterfConfig } from "../project-model/source-config.js";
9
- import { projectRawSnapshot, resolveCompiledRawPath } from "../compiler/raw-snapshot.js";
10
- import { refreshCompiledArtifacts } from "../compiler/state.js";
11
- import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compiler/compiled-paths.js";
12
- function toPortableRelativePath(fromPath, toPath) {
13
- return relative(fromPath, toPath).split(sep).join("/");
14
- }
5
+ import { readInterfConfig, resolveSourceInputPath } from "../../project/interf.js";
6
+ import { projectSourceFilesTestQueryShell } from "../agents/lib/shells.js";
7
+ import { asPreparationDataDir, preparationPortableContextPath, } from "../../contracts/lib/preparation-paths.js";
8
+ import { saveCompiledInterfConfig } from "../../project/source-config.js";
9
+ import { buildCompiledSourceFiles } from "../compile/source-files.js";
10
+ import { refreshCompiledArtifacts } from "../compile/state.js";
11
+ import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compile/compiled-paths.js";
15
12
  function sanitizeCompiledArtifacts(compiledPath) {
16
13
  for (const absolutePath of [
17
14
  testRootForCompiled(compiledPath),
@@ -28,16 +25,14 @@ export function createTestSandbox(target) {
28
25
  let sandboxRoot = mkdtempSync(join(tmpdir(), "interf-test-sandbox-"));
29
26
  let preserved = false;
30
27
  const sandboxCompiledPath = () => (target.type === "compiled"
31
- ? portableContextPath(sandboxRoot, target.name)
28
+ ? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
32
29
  : null);
33
- const sandboxRawPath = () => (target.type === "compiled"
34
- ? join(portableContextPath(sandboxRoot, target.name), "raw")
35
- : join(sandboxRoot, "raw"));
36
30
  const sandboxTargetPath = () => (target.type === "compiled"
37
- ? portableContextPath(sandboxRoot, target.name)
31
+ ? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
38
32
  : sandboxRoot);
39
33
  try {
40
34
  if (target.type === "compiled") {
35
+ const sourceInputPath = resolveSourceInputPath(target.path);
41
36
  mkdirSync(dirname(sandboxTargetPath()), { recursive: true });
42
37
  cpSync(target.path, sandboxTargetPath(), { recursive: true });
43
38
  sanitizeCompiledArtifacts(sandboxTargetPath());
@@ -45,29 +40,21 @@ export function createTestSandbox(target) {
45
40
  if (!sandboxConfig) {
46
41
  throw new Error(`Sandbox portable context is missing interf.json: ${sandboxTargetPath()}`);
47
42
  }
48
- if (!existsSync(resolveCompiledRawPath(sandboxTargetPath(), sandboxConfig))) {
49
- throw new Error(`Sandbox portable context is missing its local raw snapshot: ${sandboxTargetPath()}. Rebuild the portable context before testing it.`);
50
- }
51
43
  saveCompiledInterfConfig(sandboxTargetPath(), {
52
44
  ...sandboxConfig,
53
45
  checks: [],
54
46
  source: {
55
- path: toPortableRelativePath(sandboxTargetPath(), sandboxRawPath()),
47
+ path: sourceInputPath,
48
+ preparation_path: sourceInputPath,
56
49
  },
57
50
  });
58
51
  refreshCompiledBootstrapGuidance(sandboxTargetPath());
59
52
  refreshCompiledArtifacts(sandboxTargetPath(), { ensureViewSpec: true });
60
53
  }
61
54
  else {
62
- projectRawSnapshot({
63
- sourcePath: target.path,
64
- destinationPath: sandboxRawPath(),
65
- compiledPath: target.path,
66
- mode: "link-or-copy",
67
- prune: false,
68
- preserveTimestamps: false,
69
- });
70
- projectRawTestQueryShell(sandboxTargetPath());
55
+ mkdirSync(join(sandboxTargetPath(), "runtime"), { recursive: true });
56
+ writeFileSync(join(sandboxTargetPath(), "runtime", "source-files.json"), `${JSON.stringify(buildCompiledSourceFiles(sandboxTargetPath(), target.path), null, 2)}\n`);
57
+ projectSourceFilesTestQueryShell(sandboxTargetPath());
71
58
  }
72
59
  }
73
60
  catch (error) {
@@ -78,9 +65,6 @@ export function createTestSandbox(target) {
78
65
  get rootPath() {
79
66
  return sandboxRoot;
80
67
  },
81
- get rawPath() {
82
- return sandboxRawPath();
83
- },
84
68
  get targetPath() {
85
69
  return sandboxTargetPath();
86
70
  },
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
2
2
  import { basename, extname, join } from "node:path";
3
- import { readJsonFileWithSchema } from "../shared/parse.js";
3
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
4
4
  import { TestSpecSchema } from "./lib/schema.js";
5
5
  import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./test-paths.js";
6
6
  function readTestSpecFile(filePath) {
@@ -1,5 +1,5 @@
1
1
  import type { TestTargetCandidate } from "./test-types.js";
2
2
  export declare function listCompiledTestTargets(sourcePath: string): TestTargetCandidate[];
3
3
  export declare function createCompiledTestTarget(compiledPath: string, compiledName: string, methodId?: string): TestTargetCandidate;
4
- export declare function createRawTestTarget(sourcePath: string): TestTargetCandidate;
4
+ export declare function createSourceFilesTestTarget(sourcePath: string): TestTargetCandidate;
5
5
  export declare function listTestTargets(sourcePath: string): TestTargetCandidate[];
@@ -1,6 +1,6 @@
1
- import { listPortableContextsForSourceFolder } from "../project-model/interf-detect.js";
2
- import { computeCompiledHealth } from "../compiler/state.js";
3
- import { DEFAULT_METHOD_ID, resolveMethodId } from "../methods/method-resolution.js";
1
+ import { listPortableContextsForSourceFolder } from "../../project/interf-detect.js";
2
+ import { computeCompiledHealth } from "../compile/state.js";
3
+ import { DEFAULT_METHOD_ID, resolveMethodId } from "../../methods/method-resolution.js";
4
4
  function summarizeTargetSortKey(target) {
5
5
  return `${target.name}\u0000${target.method}`;
6
6
  }
@@ -22,15 +22,15 @@ export function createCompiledTestTarget(compiledPath, compiledName, methodId =
22
22
  eligible: health.status === "compiled",
23
23
  };
24
24
  }
25
- export function createRawTestTarget(sourcePath) {
25
+ export function createSourceFilesTestTarget(sourcePath) {
26
26
  return {
27
- type: "raw",
28
- name: "raw",
27
+ type: "source-files",
28
+ name: "source-files",
29
29
  path: sourcePath,
30
- method: "raw",
30
+ method: "source-files",
31
31
  status: "compiled",
32
- stage: "raw",
33
- summary: "Run the checks against an isolated sandbox of the raw files.",
32
+ stage: "source-files",
33
+ summary: "Run the checks against source file references in an isolated test shell.",
34
34
  eligible: true,
35
35
  };
36
36
  }
@@ -1,4 +1,4 @@
1
1
  export type { TestCaseExpect, TestCase, TestSpec, TestCheckResult, TestCaseResult, TestTargetResult, TestTargetRun, TestTargetType, LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
2
2
  export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
3
- export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
3
+ export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
4
4
  export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
@@ -1,3 +1,3 @@
1
1
  export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
2
- export { createRawTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
2
+ export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
3
3
  export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
@@ -1,6 +1,14 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import { validateMethodPackage } from "../method-package/local-methods.js";
3
- import type { SourceReadinessCheck } from "../project-model/lib/schema.js";
1
+ import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
+ import { validateMethodPackage } from "../package/local-methods.js";
3
+ import type { SourceReadinessCheck } from "../../project/lib/schema.js";
4
+ /**
5
+ * Walk method.json after a successful authoring run and fill in
6
+ * `role: "general"` for any stage missing a role field. Custom role
7
+ * names are kept as-is. Idempotent — does nothing when every stage
8
+ * already declares a role. Returns the list of stage ids that were
9
+ * touched so the runtime can surface that to the user.
10
+ */
11
+ export declare function ensureStageRoles(methodPath: string): string[];
4
12
  export interface MethodAuthoringRunResult {
5
13
  status: "updated" | "no-change" | "invalid" | "executor-failed";
6
14
  changed: boolean;
@@ -10,7 +18,7 @@ export interface MethodAuthoringRunResult {
10
18
  shellPath: string;
11
19
  }
12
20
  export declare function runMethodAuthoringDraft(options: {
13
- sourcePath: string;
21
+ prepDataDir: string;
14
22
  sourceFolderPath: string;
15
23
  baseMethodId?: string;
16
24
  methodId: string;
@@ -1,9 +1,62 @@
1
- import { rmSync } from "node:fs";
2
- import { createMethodAuthoringShell } from "../agents/lib/shells.js";
3
- import { createScratchLocalMethodPackage } from "../method-package/interf-method-package.js";
4
- import { CONTEXT_INTERFACE_FILE } from "../method-package/context-interface.js";
5
- import { loadMethodDefinitionFromDir, validateMethodPackage, methodDefinitionPath, } from "../method-package/local-methods.js";
1
+ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { createMethodAuthoringShell } from "../../engine/agents/lib/shells.js";
4
+ import { createScratchLocalMethodPackage } from "../package/interf-method-package.js";
5
+ import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
6
+ import { loadMethodDefinitionFromDir, validateMethodPackage, methodDefinitionPath, } from "../package/local-methods.js";
6
7
  import { runMethodEditSession } from "./method-edit-session.js";
8
+ /**
9
+ * Walk method.json after a successful authoring run and fill in
10
+ * `role: "general"` for any stage missing a role field. Custom role
11
+ * names are kept as-is. Idempotent — does nothing when every stage
12
+ * already declares a role. Returns the list of stage ids that were
13
+ * touched so the runtime can surface that to the user.
14
+ */
15
+ export function ensureStageRoles(methodPath) {
16
+ const methodJsonPath = join(methodPath, "method.json");
17
+ if (!existsSync(methodJsonPath))
18
+ return [];
19
+ let raw;
20
+ try {
21
+ raw = readFileSync(methodJsonPath, "utf8");
22
+ }
23
+ catch {
24
+ return [];
25
+ }
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(raw);
29
+ }
30
+ catch {
31
+ return [];
32
+ }
33
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
34
+ return [];
35
+ const value = parsed;
36
+ if (!Array.isArray(value.stages))
37
+ return [];
38
+ const touched = [];
39
+ let changed = false;
40
+ const nextStages = value.stages.map((stage) => {
41
+ if (!stage || typeof stage !== "object" || Array.isArray(stage))
42
+ return stage;
43
+ const stageRecord = stage;
44
+ const declaredRole = typeof stageRecord.role === "string" && stageRecord.role.trim().length > 0
45
+ ? stageRecord.role.trim()
46
+ : null;
47
+ if (declaredRole)
48
+ return stage;
49
+ const id = typeof stageRecord.id === "string" ? stageRecord.id : "(unknown)";
50
+ touched.push(id);
51
+ changed = true;
52
+ return { ...stageRecord, role: "general" };
53
+ });
54
+ if (!changed)
55
+ return [];
56
+ value.stages = nextStages;
57
+ writeFileSync(methodJsonPath, `${JSON.stringify(value, null, 2)}\n`);
58
+ return touched;
59
+ }
7
60
  function buildMethodAuthoringPrompt() {
8
61
  return [
9
62
  "This is an automated Interf Method-authoring run, not an open-ended chat session.",
@@ -14,13 +67,14 @@ function buildMethodAuthoringPrompt() {
14
67
  `Then read \`method/README.md\`, \`method/method.json\`, and \`method/${CONTEXT_INTERFACE_FILE}\`.`,
15
68
  "The `method/` directory starts as a neutral Method package scaffold, not as a suggested Method.",
16
69
  "Replace the scaffold purpose, inputs, context interface, stages, stage docs, proof rules, and query guidance with the Method this agent work actually needs.",
17
- "Review `artifacts/source-folder/raw/` before editing the package.",
70
+ "Read `runtime/source-files.json` and inspect the listed source locators before editing the package.",
18
71
  "Prefer direct file-reading and search tools over shell commands for routine file inspection.",
19
72
  "Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
20
73
  "Edit only files under `method/`.",
21
74
  "Keep the Method package valid for the current compiler API and `method.schema.json`.",
22
75
  "Choose stage ids, stage order, reads, writes, acceptance criteria, and stage docs from the source data and preparation-and-evidence brief.",
23
76
  "Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
77
+ "Each stage MAY declare a `role`: one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Pick the role that best matches what the stage's prompt asks the agent to do. Omit `role` (or use `general`) when the stage doesn't fit any specialized role. Custom role names are allowed; the engine treats unknown roles as `general`.",
24
78
  "Do not preserve the placeholder `prepare` stage unless the final Method genuinely needs a stage with that exact role.",
25
79
  "When editing acceptance criteria: `zone_counts_at_least` maps declared zone ids to fixed numeric minimums.",
26
80
  "`zone_counts_at_least_counts` also maps declared zone ids to runtime count-key strings such as `source_total`; `source_total` is a value, never a zone key.",
@@ -76,7 +130,7 @@ function validateAuthoredMethodPackage(methodPath) {
76
130
  }
77
131
  export async function runMethodAuthoringDraft(options) {
78
132
  const methodPath = createScratchLocalMethodPackage({
79
- sourcePath: options.sourcePath,
133
+ prepDataDir: options.prepDataDir,
80
134
  methodId: options.methodId,
81
135
  label: options.label,
82
136
  hint: options.hint,
@@ -102,6 +156,15 @@ export async function runMethodAuthoringDraft(options) {
102
156
  if (session.status !== "updated") {
103
157
  rmSync(methodPath, { recursive: true, force: true });
104
158
  }
159
+ else {
160
+ // 0.15 — auto-fill `role: "general"` for any stage the agent
161
+ // didn't explicitly tag. Idempotent and silent when every stage
162
+ // already declares a role.
163
+ const touched = ensureStageRoles(methodPath);
164
+ if (touched.length > 0 && options.onStatus) {
165
+ options.onStatus(`STATUS: filled role=general on ${touched.length} stage(s) the author didn't tag (${touched.join(", ")}).`);
166
+ }
167
+ }
105
168
  return {
106
169
  status: session.status,
107
170
  changed: session.changed,
@@ -1,5 +1,5 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import type { MethodValidationResult } from "../method-package/local-methods.js";
1
+ import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
+ import type { MethodValidationResult } from "../package/local-methods.js";
3
3
  import { type MethodEditShellArtifacts } from "./lib/method-edit-utils.js";
4
4
  export interface MethodEditSessionResult {
5
5
  status: "updated" | "no-change" | "invalid" | "executor-failed";
@@ -1,7 +1,7 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import { type MethodValidationResult } from "../method-package/local-methods.js";
3
- import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
4
- import type { MethodImprovementLoopSummary } from "../compiler/lib/schema.js";
1
+ import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
+ import { type MethodValidationResult } from "../package/local-methods.js";
3
+ import type { SourcePreparationConfig } from "../../project/lib/schema.js";
4
+ import type { MethodImprovementLoopSummary } from "../../engine/compile/lib/schema.js";
5
5
  export interface MethodImprovementRunResult {
6
6
  status: "updated" | "no-change" | "invalid" | "executor-failed";
7
7
  changed: boolean;
@@ -1,15 +1,16 @@
1
1
  import { appendFileSync, existsSync, mkdirSync, writeFileSync, } from "node:fs";
2
2
  import { join, relative } from "node:path";
3
- import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../agents/lib/shells.js";
4
- import { validateMethodPackage } from "../method-package/local-methods.js";
5
- import { CONTEXT_INTERFACE_FILE } from "../method-package/context-interface.js";
6
- import { readJsonFileWithSchema } from "../shared/parse.js";
7
- import { resolveMethodImprovementReviewPaths } from "../method-package/method-review-paths.js";
8
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../compiler/compiled-paths.js";
9
- import { readInterfConfig } from "../project-model/interf.js";
10
- import { saveCompiledInterfConfig } from "../project-model/source-config.js";
11
- import { MethodImprovementRunLedgerSchema, } from "../compiler/lib/schema.js";
3
+ import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../../engine/agents/lib/shells.js";
4
+ import { validateMethodPackage } from "../package/local-methods.js";
5
+ import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
6
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
7
+ import { resolveMethodImprovementReviewPaths } from "../package/method-review-paths.js";
8
+ import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../../engine/compile/compiled-paths.js";
9
+ import { readInterfConfig } from "../../project/interf.js";
10
+ import { saveCompiledInterfConfig } from "../../project/source-config.js";
11
+ import { MethodImprovementRunLedgerSchema, } from "../../engine/compile/lib/schema.js";
12
12
  import { runMethodEditSession } from "./method-edit-session.js";
13
+ import { ensureStageRoles } from "./method-authoring.js";
13
14
  function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
14
15
  if (!absolutePath)
15
16
  return null;
@@ -64,7 +65,7 @@ function buildMethodImprovementPrompt() {
64
65
  "Treat the Method package as four aligned layers: purpose, inputs, context interface, and stages.",
65
66
  "Prefer editing the stage docs, Method contract, input contract, or schema ownership that actually change portable-context outputs.",
66
67
  "Edit only files under `method/`.",
67
- "Do not edit checks, test specs, raw source files, or generated portable-context outputs.",
68
+ "Do not edit checks, test specs, source files, or generated portable-context outputs.",
68
69
  "Keep the Method package valid for the current compiler API and `method.schema.json`.",
69
70
  "Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read zones.",
70
71
  "Do not make one stage point at files or notes that are only created later by another stage.",
@@ -169,6 +170,11 @@ export async function runMethodImprovementLoop(options) {
169
170
  validate: validateMethodPackage,
170
171
  maxValidationRepairAttempts: 1,
171
172
  });
173
+ if (session.status === "updated") {
174
+ // 0.15 — fill role=general on any stage the improvement run
175
+ // dropped a role from. Idempotent and silent when complete.
176
+ ensureStageRoles(methodRoot);
177
+ }
172
178
  const preservedShellManifestPath = freezeMethodImprovementShell(shell.rootPath);
173
179
  writeMethodImprovementRunLedger(options.compiledPath, options.runId, buildMethodImprovementLoopRecord({
174
180
  targetName: compiledName,
@@ -1,12 +1,11 @@
1
- import { COMPILED_ZONE_KINDS, type CompiledZoneKind } from "../compiler/method-primitives.js";
2
- export declare const BUILTIN_COMPILED_STAGE_IDS: {
1
+ import { type CompiledZoneKind } from "../../engine/compile/method-primitives.js";
2
+ declare const BUILTIN_COMPILED_STAGE_IDS: {
3
3
  readonly SUMMARIZE: "summarize";
4
4
  readonly STRUCTURE: "structure";
5
5
  readonly SHAPE: "shape";
6
6
  };
7
- export type BuiltinCompiledStageId = typeof BUILTIN_COMPILED_STAGE_IDS[keyof typeof BUILTIN_COMPILED_STAGE_IDS];
7
+ type BuiltinCompiledStageId = typeof BUILTIN_COMPILED_STAGE_IDS[keyof typeof BUILTIN_COMPILED_STAGE_IDS];
8
8
  export declare const BUILTIN_COMPILED_ZONE_IDS: {
9
- readonly RAW: "raw";
10
9
  readonly SUMMARIES: "summaries";
11
10
  readonly KNOWLEDGE_ENTITIES: "knowledge-entities";
12
11
  readonly KNOWLEDGE_CLAIMS: "knowledge-claims";
@@ -35,4 +34,4 @@ export declare function requiredCompiledZoneOwners<TStage extends {
35
34
  id: string;
36
35
  writes: readonly string[];
37
36
  }>(stages: readonly TStage[], zoneId: BuiltinCompiledZoneId): string[];
38
- export { COMPILED_ZONE_KINDS };
37
+ export {};
@@ -1,16 +1,14 @@
1
1
  import { join } from "node:path";
2
2
  import { z } from "zod";
3
- import { readJsonFileWithSchema } from "../shared/parse.js";
4
- import { COMPILED_ZONE_KINDS } from "../compiler/method-primitives.js";
5
- import { MethodCompiledSchemaSchema } from "../compiler/lib/schema.js";
3
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
4
+ import { MethodCompiledSchemaSchema } from "../../engine/compile/lib/schema.js";
6
5
  import { PACKAGE_ROOT } from "./lib/package-root.js";
7
- export const BUILTIN_COMPILED_STAGE_IDS = {
6
+ const BUILTIN_COMPILED_STAGE_IDS = {
8
7
  SUMMARIZE: "summarize",
9
8
  STRUCTURE: "structure",
10
9
  SHAPE: "shape",
11
10
  };
12
11
  export const BUILTIN_COMPILED_ZONE_IDS = {
13
- RAW: "raw",
14
12
  SUMMARIES: "summaries",
15
13
  KNOWLEDGE_ENTITIES: "knowledge-entities",
16
14
  KNOWLEDGE_CLAIMS: "knowledge-claims",
@@ -30,12 +28,7 @@ const BuiltinMethodPackageSchema = z.object({
30
28
  stages: z.array(BuiltinMethodStageSchema).min(1),
31
29
  });
32
30
  let builtinCompiledContractCache = null;
33
- function builtinMethodRootPath() {
34
- return join(PACKAGE_ROOT, "builtin-methods", "interf-default");
35
- }
36
- function builtinMethodPath(relativePath) {
37
- return join(builtinMethodRootPath(), relativePath);
38
- }
31
+ const BUILTIN_DEFAULT_METHOD_ROOT = join(PACKAGE_ROOT, "builtin-methods", "interf-default");
39
32
  function assertBuiltinZoneId(value) {
40
33
  if (!BUILTIN_ZONE_ID_SET.has(value)) {
41
34
  throw new Error(`Built-in Interf Method schema declares unsupported zone id "${value}".`);
@@ -51,13 +44,15 @@ function assertBuiltinStageId(value) {
51
44
  function loadBuiltinCompiledContract() {
52
45
  if (builtinCompiledContractCache)
53
46
  return builtinCompiledContractCache;
54
- const schema = readJsonFileWithSchema(builtinMethodPath("method.schema.json"), "built-in Interf Method schema", MethodCompiledSchemaSchema);
47
+ const schemaPath = join(BUILTIN_DEFAULT_METHOD_ROOT, "method.schema.json");
48
+ const methodPath = join(BUILTIN_DEFAULT_METHOD_ROOT, "method.json");
49
+ const schema = readJsonFileWithSchema(schemaPath, "built-in Interf Method schema", MethodCompiledSchemaSchema);
55
50
  if (!schema) {
56
- throw new Error(`Missing or invalid built-in Method schema at ${builtinMethodPath("method.schema.json")}.`);
51
+ throw new Error(`Missing or invalid built-in Method schema at ${schemaPath}.`);
57
52
  }
58
- const method = readJsonFileWithSchema(builtinMethodPath("method.json"), "built-in Interf Method package", BuiltinMethodPackageSchema);
53
+ const method = readJsonFileWithSchema(methodPath, "built-in Interf Method package", BuiltinMethodPackageSchema);
59
54
  if (!method) {
60
- throw new Error(`Missing or invalid built-in Method package at ${builtinMethodPath("method.json")}.`);
55
+ throw new Error(`Missing or invalid built-in Method package at ${methodPath}.`);
61
56
  }
62
57
  const zones = schema.zones.map((zone) => ({
63
58
  id: assertBuiltinZoneId(zone.id),
@@ -91,4 +86,3 @@ export function requiredCompiledZoneOwners(stages, zoneId) {
91
86
  .filter((stage) => stage.writes.includes(zoneId))
92
87
  .map((stage) => stage.id)));
93
88
  }
94
- export { COMPILED_ZONE_KINDS };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "../compiler/lib/schema.js";
2
+ import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "../../engine/compile/lib/schema.js";
3
3
  export declare const CONTEXT_INTERFACE_FILE = "method.schema.json";
4
4
  export declare const ContextInterfaceSchema: z.ZodObject<{
5
5
  kind: z.ZodLiteral<"method-schema">;
@@ -9,8 +9,8 @@ export declare const ContextInterfaceSchema: z.ZodObject<{
9
9
  zones: z.ZodArray<z.ZodObject<{
10
10
  id: z.ZodString;
11
11
  role: z.ZodEnum<{
12
- output: "output";
13
12
  runtime: "runtime";
13
+ output: "output";
14
14
  input: "input";
15
15
  working: "working";
16
16
  }>;
@@ -25,31 +25,6 @@ export declare const ContextInterfaceSchema: z.ZodObject<{
25
25
  description: z.ZodString;
26
26
  }, z.core.$strip>>;
27
27
  }, z.core.$strip>;
28
- export declare const ContextInterfaceZoneSchema: z.ZodObject<{
29
- id: z.ZodString;
30
- role: z.ZodEnum<{
31
- output: "output";
32
- runtime: "runtime";
33
- input: "input";
34
- working: "working";
35
- }>;
36
- path: z.ZodString;
37
- kind: z.ZodEnum<{
38
- runtime: "runtime";
39
- file: "file";
40
- directory: "directory";
41
- }>;
42
- required: z.ZodBoolean;
43
- owned_by: z.ZodArray<z.ZodString>;
44
- description: z.ZodString;
45
- }, z.core.$strip>;
46
- export declare const ContextInterfaceZoneIdSchema: z.ZodString;
47
- export declare const ContextInterfaceZoneRoleSchema: z.ZodEnum<{
48
- output: "output";
49
- runtime: "runtime";
50
- input: "input";
51
- working: "working";
52
- }>;
53
28
  export declare const MethodInputSpecSchema: z.ZodObject<{
54
29
  id: z.ZodString;
55
30
  label: z.ZodString;
@@ -57,23 +32,15 @@ export declare const MethodInputSpecSchema: z.ZodObject<{
57
32
  required: z.ZodDefault<z.ZodBoolean>;
58
33
  examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
34
  }, z.core.$strict>;
60
- export declare const MethodInputContractSchema: z.ZodArray<z.ZodObject<{
61
- id: z.ZodString;
62
- label: z.ZodString;
63
- description: z.ZodString;
64
- required: z.ZodDefault<z.ZodBoolean>;
65
- examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
- }, z.core.$strict>>;
67
35
  export type ContextInterface = MethodCompiledSchema;
68
36
  export type ContextInterfaceZone = MethodCompiledZone;
69
37
  export type ContextInterfaceZoneId = MethodZoneId;
70
- export type ContextInterfaceZoneRole = z.infer<typeof ContextInterfaceZoneRoleSchema>;
71
38
  export type MethodInputSpec = z.infer<typeof MethodInputSpecSchema>;
72
- export interface ContextInterfaceStageLike {
39
+ interface ContextInterfaceStageLike {
73
40
  id: string;
74
41
  writes: readonly string[];
75
42
  }
76
- export interface ContextInterfaceSummary {
43
+ interface ContextInterfaceSummary {
77
44
  inputZones: ContextInterfaceZone[];
78
45
  workingZones: ContextInterfaceZone[];
79
46
  outputZones: ContextInterfaceZone[];
@@ -82,15 +49,12 @@ export interface ContextInterfaceSummary {
82
49
  export declare function contextInterfaceFilePath(rootPath: string): string;
83
50
  export declare function resolveContextInterfacePath(rootPath: string): string | null;
84
51
  export declare function contextInterfaceExists(rootPath: string): boolean;
85
- export declare function contextInterfaceRelativePath(): string;
86
- export declare function listContextInterfaceZones(contextInterface: ContextInterface): ContextInterfaceZone[];
87
- export declare function findContextInterfaceZone(contextInterface: ContextInterface, zoneId: ContextInterfaceZoneId): ContextInterfaceZone | null;
88
52
  export declare function contextInterfaceZoneAbsolutePath(compiledPath: string, zone: Pick<ContextInterfaceZone, "path">): string;
89
53
  export declare function contextInterfaceArtifactPath(zone: Pick<ContextInterfaceZone, "path" | "kind">): string;
90
- export declare function contextInterfaceArtifactPathsForZoneIds(contextInterface: ContextInterface, zoneIds: readonly ContextInterfaceZoneId[]): string[];
91
54
  export declare function summarizeContextInterface(contextInterface: ContextInterface): ContextInterfaceSummary;
92
55
  export declare function deriveMethodInputsFromContextInterface(contextInterface: ContextInterface | null | undefined): MethodInputSpec[];
93
56
  export declare function buildContextInterface(stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
94
57
  export declare function writeContextInterfaceFile(rootPath: string, stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
95
58
  export declare function writeContextInterface(rootPath: string, contextInterface: ContextInterface): ContextInterface;
96
59
  export declare function readContextInterface(rootPath: string): ContextInterface | null;
60
+ export {};