@interf/compiler 0.13.0 → 0.18.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 (320) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +50 -7
  3. package/TRADEMARKS.md +4 -4
  4. package/agent-skills/interf-actions/SKILL.md +51 -5
  5. package/agent-skills/interf-actions/references/cli.md +82 -82
  6. package/builtin-methods/interf-default/README.md +6 -7
  7. package/builtin-methods/interf-default/method.json +7 -68
  8. package/builtin-methods/interf-default/method.schema.json +52 -50
  9. package/dist/cli/commands/agents.d.ts +2 -0
  10. package/dist/cli/commands/agents.js +213 -0
  11. package/dist/cli/commands/compile.js +10 -1
  12. package/dist/cli/commands/doctor.js +1 -1
  13. package/dist/cli/commands/login.js +1 -1
  14. package/dist/cli/commands/logout.js +1 -1
  15. package/dist/cli/commands/mcp.d.ts +42 -0
  16. package/dist/cli/commands/mcp.js +239 -0
  17. package/dist/cli/commands/method.js +1 -1
  18. package/dist/cli/commands/prep.js +81 -7
  19. package/dist/cli/commands/reset.js +1 -1
  20. package/dist/cli/commands/runs.js +1 -1
  21. package/dist/cli/commands/status.js +1 -1
  22. package/dist/cli/commands/verify.d.ts +10 -0
  23. package/dist/cli/commands/{test.js → verify.js} +30 -15
  24. package/dist/cli/commands/web.js +71 -18
  25. package/dist/cli/commands/wizard.js +462 -107
  26. package/dist/cli/index.d.ts +4 -2
  27. package/dist/cli/index.js +7 -3
  28. package/dist/compiler-ui/404.html +1 -1
  29. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  30. package/dist/compiler-ui/__next._full.txt +3 -3
  31. package/dist/compiler-ui/__next._head.txt +1 -1
  32. package/dist/compiler-ui/__next._index.txt +2 -2
  33. package/dist/compiler-ui/__next._tree.txt +2 -2
  34. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
  35. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
  36. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  37. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  38. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  39. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  40. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  41. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  42. package/dist/compiler-ui/_not-found.html +1 -1
  43. package/dist/compiler-ui/_not-found.txt +2 -2
  44. package/dist/compiler-ui/index.html +1 -1
  45. package/dist/compiler-ui/index.txt +3 -3
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.js +2 -2
  48. package/dist/packages/contracts/index.d.ts +2 -1
  49. package/dist/packages/contracts/index.js +1 -0
  50. package/dist/packages/contracts/lib/schema.d.ts +324 -31
  51. package/dist/packages/contracts/lib/schema.js +281 -21
  52. package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
  53. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  54. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  55. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  56. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  57. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  58. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  59. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  60. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  61. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
  62. package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
  63. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  64. package/dist/packages/engine/agents/registry.d.ts +91 -0
  65. package/dist/packages/engine/agents/registry.js +321 -0
  66. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  67. package/dist/packages/engine/agents/role-executors.js +88 -0
  68. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  69. package/dist/packages/engine/agents/role-router.js +73 -0
  70. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  71. package/dist/packages/{local-service → engine}/client.js +11 -11
  72. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  73. package/dist/packages/engine/cloud-seams.js +84 -0
  74. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
  75. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
  76. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  77. package/dist/packages/engine/compile/artifact-status.js +166 -0
  78. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  79. package/dist/packages/engine/compile/billing-events.js +74 -0
  80. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  81. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  82. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  83. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  84. package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
  85. package/dist/packages/engine/compile/compiled-schema.js +126 -0
  86. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
  87. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
  88. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  89. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
  90. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  91. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  92. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  93. package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
  94. package/dist/packages/{compiler → engine/compile}/index.js +0 -1
  95. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
  96. package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
  97. package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
  98. package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
  99. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  100. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  101. package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
  102. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
  103. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
  104. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  105. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
  106. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  107. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
  108. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
  109. package/dist/packages/engine/compile/runtime.d.ts +5 -0
  110. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
  111. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  112. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  113. package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
  114. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  115. package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
  116. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
  117. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  118. package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
  119. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
  120. package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
  121. package/dist/packages/engine/index.d.ts +22 -0
  122. package/dist/packages/engine/index.js +15 -0
  123. package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
  124. package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
  125. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  126. package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
  127. package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
  128. package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
  129. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  130. package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
  131. package/dist/packages/{local-service → engine}/routes.js +38 -1
  132. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  133. package/dist/packages/{local-service → engine}/run-observability.js +15 -15
  134. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  135. package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
  136. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  137. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  138. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  139. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  140. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
  141. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
  142. package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
  143. package/dist/packages/{local-service → engine}/runtime.js +333 -205
  144. package/dist/packages/{local-service → engine}/server.d.ts +25 -0
  145. package/dist/packages/{local-service → engine}/server.js +338 -17
  146. package/dist/packages/engine/verify/index.d.ts +13 -0
  147. package/dist/packages/engine/verify/index.js +10 -0
  148. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  149. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  150. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
  151. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
  152. package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
  153. package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
  154. package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
  155. package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
  156. package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
  157. package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
  158. package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
  159. package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
  160. package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
  161. package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
  162. package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
  163. package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
  164. package/dist/packages/engine/wire-schemas.d.ts +545 -0
  165. package/dist/packages/engine/wire-schemas.js +59 -0
  166. package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
  167. package/dist/packages/methods/authoring/method-authoring.js +260 -0
  168. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  169. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
  170. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  171. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  172. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
  173. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
  174. package/dist/packages/methods/package/context-interface.d.ts +73 -0
  175. package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
  176. package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
  177. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  178. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
  179. package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
  180. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
  181. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
  182. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
  183. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
  184. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  185. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  186. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  187. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  188. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  189. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  190. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  191. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  192. package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
  193. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  194. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  195. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  196. package/dist/packages/{project-model → project}/source-config.js +9 -8
  197. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  198. package/package.json +7 -16
  199. package/dist/cli/commands/test.d.ts +0 -9
  200. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
  201. package/dist/packages/agents/lib/detection.d.ts +0 -7
  202. package/dist/packages/compiler/artifact-counts.d.ts +0 -1
  203. package/dist/packages/compiler/compiled-schema.d.ts +0 -31
  204. package/dist/packages/compiler/compiled-schema.js +0 -141
  205. package/dist/packages/compiler/method-primitives.d.ts +0 -2
  206. package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
  207. package/dist/packages/compiler/runtime-acceptance.js +0 -262
  208. package/dist/packages/compiler/runtime.d.ts +0 -6
  209. package/dist/packages/local-service/index.d.ts +0 -22
  210. package/dist/packages/local-service/index.js +0 -15
  211. package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
  212. package/dist/packages/method-authoring/method-authoring.js +0 -116
  213. package/dist/packages/method-package/context-interface.d.ts +0 -60
  214. package/dist/packages/testing/index.d.ts +0 -13
  215. package/dist/packages/testing/index.js +0 -10
  216. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
  217. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
  218. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
  219. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  220. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  221. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  222. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  223. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  224. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  225. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  226. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  227. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  228. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  229. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  230. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  231. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  232. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  233. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  234. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  235. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  236. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  237. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  238. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  239. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  240. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  241. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  242. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  243. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  244. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  245. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  246. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  247. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  248. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  249. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  250. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  251. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  252. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  253. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  254. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  255. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  256. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  257. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  258. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  259. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  260. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  261. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  262. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  263. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  264. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  265. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  266. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  267. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  268. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  269. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  270. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  271. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  272. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  273. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  274. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  275. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  276. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  277. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  278. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  279. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  280. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  281. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  282. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  283. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  284. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  285. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  286. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  287. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  288. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  289. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  290. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  291. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  292. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  293. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  294. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  295. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  296. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  297. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  298. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  299. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  300. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  301. /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
  302. /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
  303. /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
  304. /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
  305. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  306. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  307. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  308. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  309. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  310. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  311. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  312. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  313. /package/dist/packages/{project-model → project}/index.js +0 -0
  314. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  315. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  316. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  317. /package/dist/packages/{project-model → project}/interf.js +0 -0
  318. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  319. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  320. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -1,7 +1,12 @@
1
1
  import { z } from "zod";
2
- import { COMPILED_ZONE_KINDS, } from "../method-primitives.js";
3
- import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
4
- export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../contracts/lib/schema.js";
2
+ import { COMPILED_ARTIFACT_KINDS, } from "../method-primitives.js";
3
+ import { ArtifactIdSchema, ArtifactSchema, CheckSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
4
+ // `ArtifactSchema` is used internally below in `MethodSchemaSchema`'s
5
+ // `artifacts[]` field. The other Artifact* schemas/types are NOT
6
+ // re-exported through this module — callers import them directly
7
+ // from `contracts/lib/schema.js`. The 0.17 PR cross-check pruned
8
+ // re-exports that had zero consumers.
9
+ export { GateStatusSchema, ReadinessGateSchema, ReadinessSchema, ReadinessStatusSchema, VerifyTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
5
10
  const JsonRecordSchema = z.record(z.string(), z.unknown());
6
11
  const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
7
12
  function isCompiledRelativePath(value) {
@@ -13,9 +18,9 @@ function isCompiledRelativePath(value) {
13
18
  .split(/[\\/]+/)
14
19
  .every((segment) => COMPILED_RELATIVE_PATH_SEGMENT.test(segment));
15
20
  }
16
- export const MethodZoneIdSchema = z.string().regex(InterfIdPattern);
17
- export const MethodCompiledZoneKindSchema = z.enum(COMPILED_ZONE_KINDS);
18
- export const MethodZoneRoleSchema = z.enum(["input", "working", "output", "runtime"]);
21
+ export const MethodArtifactIdSchema = z.string().regex(InterfIdPattern);
22
+ export const MethodCompiledArtifactKindSchema = z.enum(COMPILED_ARTIFACT_KINDS);
23
+ export const MethodArtifactRoleSchema = z.enum(["input", "working", "output", "runtime"]);
19
24
  export const CompiledStageStatusSchema = z.enum(["idle", "running", "succeeded", "failed"]);
20
25
  export const CompiledStageStateSchema = z.object({
21
26
  contract_type: RuntimeContractTypeSchema.optional(),
@@ -23,7 +28,7 @@ export const CompiledStageStateSchema = z.object({
23
28
  started_at: z.string().nullable().optional(),
24
29
  finished_at: z.string().nullable().optional(),
25
30
  counts: z.record(z.string(), z.number()).optional(),
26
- zone_counts: z.record(z.string(), z.number()).optional(),
31
+ artifact_counts: z.record(z.string(), z.number()).optional(),
27
32
  artifacts: z.array(z.string()).optional(),
28
33
  summary: z.string().nullable().optional(),
29
34
  run_id: z.string().nullable().optional(),
@@ -81,36 +86,37 @@ export const MethodPurposeSchema = z.object({
81
86
  label: z.string().min(1),
82
87
  task_hint: z.string().min(1),
83
88
  }).strict();
84
- export const MethodZoneSchema = z.object({
85
- id: MethodZoneIdSchema,
86
- role: MethodZoneRoleSchema,
89
+ export const MethodCompiledArtifactProjectionSchema = z.object({
90
+ id: MethodArtifactIdSchema,
91
+ role: MethodArtifactRoleSchema,
87
92
  path: z.string().min(1).refine(isCompiledRelativePath, {
88
- message: "Zone paths must stay inside the compiled root",
93
+ message: "Artifact paths must stay inside the compiled root",
89
94
  }),
90
- kind: MethodCompiledZoneKindSchema,
95
+ kind: MethodCompiledArtifactKindSchema,
91
96
  required: z.boolean(),
92
97
  owned_by: z.array(z.string().regex(InterfIdPattern)),
93
98
  description: z.string().min(1),
94
99
  });
95
- export const MethodCompiledZoneSchema = MethodZoneSchema;
96
- // Persisted schema for the method-defined context interface that one
100
+ export const MethodCompiledArtifactSchema = MethodCompiledArtifactProjectionSchema;
101
+ // Persisted schema for the method-defined artifact interface that one
97
102
  // portable context must implement on disk.
98
103
  export const MethodSchemaSchema = z.object({
99
104
  kind: z.literal("method-schema"),
100
105
  version: z.literal(1),
101
106
  target_type: z.literal("compiled"),
102
107
  label: z.string().min(1),
103
- zones: z.array(MethodZoneSchema).min(1),
104
- });
108
+ artifacts: z.array(ArtifactSchema).min(1),
109
+ }).strict();
105
110
  export const MethodCompiledSchemaSchema = MethodSchemaSchema;
106
111
  export const MethodCompilerApiSchema = z.object({
107
112
  kind: z.literal("compiled"),
108
113
  version: z.literal(1),
109
114
  });
110
- export const MethodStageZoneAccessSchema = z.array(MethodZoneIdSchema).min(1);
111
- export const ExecutionShellZoneMountSchema = z.object({
112
- zone_id: MethodZoneIdSchema,
113
- compiled_path: z.string(),
115
+ export const MethodStageArtifactReadAccessSchema = z.array(ArtifactIdSchema);
116
+ export const MethodStageArtifactWriteAccessSchema = z.array(ArtifactIdSchema).min(1);
117
+ export const ExecutionShellArtifactMountSchema = z.object({
118
+ artifact_id: ArtifactIdSchema,
119
+ artifact_path: z.string(),
114
120
  shell_root_path: z.string(),
115
121
  input_mount_path: z.string().nullable(),
116
122
  output_mount_path: z.string().nullable(),
@@ -120,8 +126,8 @@ export const ExecutionShellPathsSchema = z.object({
120
126
  version: z.literal(1),
121
127
  method: MethodIdSchema,
122
128
  stage: RuntimeStageSchema,
123
- reads: z.array(ExecutionShellZoneMountSchema),
124
- writes: z.array(ExecutionShellZoneMountSchema),
129
+ reads: z.array(ExecutionShellArtifactMountSchema),
130
+ writes: z.array(ExecutionShellArtifactMountSchema),
125
131
  });
126
132
  export const RuntimeStageInstructionsSchema = z.object({
127
133
  stage_skill_dir: z.string().regex(InterfIdPattern),
@@ -130,20 +136,6 @@ export const RuntimeStageInstructionsSchema = z.object({
130
136
  local_docs: z.array(z.string()),
131
137
  mode_sources: z.array(z.string()),
132
138
  }).strict();
133
- export const RuntimeStageAcceptanceSchema = z.object({
134
- artifacts_exist: z.array(z.string()).optional(),
135
- stage_truthy: z.array(z.string()).optional(),
136
- stage_equals_counts: z.record(z.string(), z.string()).optional(),
137
- stage_at_least: z.record(z.string(), z.number()).optional(),
138
- stage_at_least_counts: z.record(z.string(), z.string()).optional(),
139
- zone_counts_at_least: z.record(z.string().regex(InterfIdPattern), z.number()).optional(),
140
- zone_counts_at_least_counts: z.record(z.string().regex(InterfIdPattern), z.string()).optional(),
141
- markdown_frontmatter_valid_zones: z.array(MethodZoneIdSchema).optional(),
142
- frontmatter_required_keys_in_zones: z.record(MethodZoneIdSchema, z.array(z.string().min(1)).min(1)).optional(),
143
- markdown_abstract_valid_zones: z.array(MethodZoneIdSchema).optional(),
144
- wikilinks_valid_in_zones: z.array(MethodZoneIdSchema).optional(),
145
- artifacts_must_not_contain: z.record(z.string(), z.array(z.string().min(1))).optional(),
146
- }).strict();
147
139
  export const RuntimeStageContractSchema = z.object({
148
140
  kind: z.literal("interf-stage-contract"),
149
141
  version: z.literal(1),
@@ -163,10 +155,14 @@ export const RuntimeStageContractSchema = z.object({
163
155
  executor: RuntimeExecutorInfoSchema,
164
156
  instructions: RuntimeStageInstructionsSchema,
165
157
  counts: z.record(z.string(), z.number()),
166
- acceptance: RuntimeStageAcceptanceSchema.optional(),
167
158
  artifacts: z.object({
168
159
  reads: z.array(z.string()),
169
160
  writes: z.array(z.string()),
161
+ write_contracts: z.array(z.object({
162
+ artifact_id: ArtifactIdSchema,
163
+ path: z.string().min(1),
164
+ checks: z.array(CheckSchema),
165
+ }).strict()).default([]),
170
166
  }),
171
167
  policies: z.object({
172
168
  execution_mode: z.literal("deterministic"),
@@ -211,9 +207,9 @@ export const RuntimeRunSchema = z.object({
211
207
  error: z.string().nullable(),
212
208
  });
213
209
  export const CompiledInventoryEntrySchema = z.object({
214
- input_zone: MethodZoneIdSchema.optional(),
210
+ input_artifact: ArtifactIdSchema.optional(),
215
211
  input_path: z.string().min(1).optional(),
216
- output_zone: MethodZoneIdSchema,
212
+ output_artifact: ArtifactIdSchema,
217
213
  output_path: z.string().min(1),
218
214
  state: z.string().min(1).optional(),
219
215
  metadata: JsonRecordSchema.optional(),
@@ -0,0 +1,2 @@
1
+ export declare const COMPILED_ARTIFACT_KINDS: readonly ["directory", "file", "runtime"];
2
+ export type CompiledArtifactKind = typeof COMPILED_ARTIFACT_KINDS[number];
@@ -1,4 +1,4 @@
1
- export const COMPILED_ZONE_KINDS = [
1
+ export const COMPILED_ARTIFACT_KINDS = [
2
2
  "directory",
3
3
  "file",
4
4
  "runtime",
@@ -1,5 +1,5 @@
1
- import { type InterfConfig } from "../project-model/interf-detect.js";
2
- export type { MethodReporter } from "../method-package/method-helpers.js";
1
+ import { type InterfConfig } from "../../project/interf-detect.js";
2
+ export type { MethodReporter } from "../../methods/package/method-helpers.js";
3
3
  export type CompiledCheck = "compiled" | "stage";
4
4
  export interface DetectedInterfTarget {
5
5
  path: string;
@@ -11,4 +11,4 @@ export declare function detectCompiled(cwd: string): DetectedInterfTarget | null
11
11
  export declare function createCompiled(name: string, sourcePath: string, methodId: string | undefined, about: string | undefined, sourceFolderPath: string): string;
12
12
  export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
13
13
  export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
14
- export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
14
+ export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, ResolveStageExecutor, } from "./compiled-compile.js";
@@ -1,7 +1,7 @@
1
- import { createCompiled as createCompiledScaffold, } from "../project-model/interf-scaffold.js";
2
- import { detectInterf } from "../project-model/interf-detect.js";
1
+ import { createCompiled as createCompiledScaffold, } from "../../project/interf-scaffold.js";
2
+ import { detectInterf } from "../../project/interf-detect.js";
3
3
  import { validateCompiledCompile, } from "./validate.js";
4
- import { DEFAULT_METHOD_ID } from "../methods/method-resolution.js";
4
+ import { DEFAULT_METHOD_ID } from "../../methods/method-resolution.js";
5
5
  export function detectCompiled(cwd) {
6
6
  const detected = detectInterf(cwd);
7
7
  if (!detected)
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readdirSync, rmSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { readCompiledSchemaFile } from "./compiled-schema.js";
3
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
4
4
  import { initializeCompiledRuntimeState } from "./state.js";
5
5
  import { stageExecutionShellsRoot, testRootForCompiled, testTargetsRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeRoot, compiledRuntimeLogsRoot, methodPackagePathForCompiled, } from "./compiled-paths.js";
6
6
  function removeIfExists(path) {
@@ -40,10 +40,10 @@ export function clearCompiledRuntimeDerivedArtifacts(compiledPath) {
40
40
  function activeCompiledInputRoots(compiledPath) {
41
41
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
42
42
  const roots = new Set();
43
- for (const zone of schema?.zones ?? []) {
44
- if (zone.role !== "input")
43
+ for (const artifact of schema ? listCompiledSchemaArtifacts(schema) : []) {
44
+ if (artifact.role !== "input")
45
45
  continue;
46
- const root = zone.path.split("/")[0]?.trim();
46
+ const root = artifact.path.split("/")[0]?.trim();
47
47
  if (root)
48
48
  roots.add(root);
49
49
  }
@@ -8,7 +8,6 @@ export function buildRuntimeStageContract(options) {
8
8
  ...(options.counts ?? {}),
9
9
  local_skill_docs: localSkillDocs.length,
10
10
  },
11
- ...(options.acceptance ? { acceptance: options.acceptance } : {}),
12
11
  artifacts: {
13
12
  reads: [
14
13
  "interf.json",
@@ -18,6 +17,7 @@ export function buildRuntimeStageContract(options) {
18
17
  ...localSkillDocs,
19
18
  ],
20
19
  writes: options.stageWriteArtifacts,
20
+ write_contracts: options.stageWriteContracts ?? [],
21
21
  },
22
22
  policies: {
23
23
  execution_mode: "deterministic",
@@ -28,6 +28,7 @@ export function buildRuntimeStageContract(options) {
28
28
  `Use \`method/${METHOD_SCHEMA_FILE}\` as the deterministic context-interface reference for this portable context.`,
29
29
  "Honor the declared read and write artifacts instead of inventing a parallel process.",
30
30
  "Only create or update files that fall under the declared write targets for this stage.",
31
+ "Before emitting DONE, satisfy every check listed under `artifacts.write_contracts[]` for the write Artifacts this stage owns.",
31
32
  "Interf writes `.interf/runtime/` ledgers such as run, state, health, and view-spec files. Read them if needed, but do not create, edit, or replace them in this stage unless the contract explicitly marks a runtime artifact as stage-owned.",
32
33
  "Keep scratch extraction commands single-purpose and non-destructive. Avoid wildcard cleanup and multi-command chains.",
33
34
  ...methodNotes,
@@ -21,9 +21,10 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
21
21
  "The user has already invoked this stage through the Interf CLI. Execute it now.",
22
22
  "Do not ask what the user wants, offer help, list tools, or wait for another instruction.",
23
23
  `Read \`${contractPath}\` first. It is the authoritative contract for this stage.`,
24
- "If `runtime/paths.json` exists in this shell, read it next. It maps Method zone ids onto the shell-local `inputs/` and `outputs/` mounts for this stage.",
25
- "For file-zone mounts, `runtime/paths.json` also gives the exact file path inside the `inputs/` or `outputs/` mount root.",
24
+ "If `runtime/paths.json` exists in this shell, read it next. It maps Method Artifact ids onto the shell-local `inputs/` and `outputs/` mounts for this stage.",
25
+ "For file Artifact mounts, `runtime/paths.json` also gives the exact file path inside the `inputs/` or `outputs/` mount root.",
26
26
  "Honor the contract's counts, artifact paths, and policies instead of inventing another Method.",
27
+ "The contract's `artifacts.write_contracts[]` lists the checks Interf will run against the Artifacts this stage writes. Treat those checks as required output constraints.",
27
28
  "Read only the files named by the contract's `artifacts.reads` list plus any paths they explicitly direct you to open.",
28
29
  "Prefer direct file-reading and search tools over shell commands when you inspect inputs, docs, or generated outputs.",
29
30
  "Do not use shell helpers like `cat`, `sed`, `ls`, or `find` for routine file inspection if a native read/search tool can do the same job.",
@@ -1,2 +1,2 @@
1
- import { type MethodStageDefinition } from "../method-package/method-definitions.js";
1
+ import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
2
2
  export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<MethodStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;
@@ -1,11 +1,12 @@
1
1
  import { existsSync, readFileSync, statSync, writeFileSync, } from "node:fs";
2
2
  import { extname, join, relative } from "node:path";
3
- import { listFilesRecursive } from "../shared/filesystem.js";
4
- import { compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
5
- import { parseJsonFrontmatter } from "../shared/parse.js";
3
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
+ import { compiledArtifactAbsolutePath, findCompiledSchemaArtifact, readCompiledSchemaFile, } from "./compiled-schema.js";
5
+ import { parseJsonFrontmatter } from "../../contracts/utils/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 { STANDARD_EVIDENCE_FRONTMATTER_KEYS, } from "../../contracts/lib/schema.js";
9
10
  import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
10
11
  import { extractSynthAbstract, isOutputMarkdownFile } from "./validate.js";
11
12
  function readActiveRunStartedAtMs(dirPath) {
@@ -37,8 +38,8 @@ function anyPathUpdatedSince(absolutePath, sinceMs) {
37
38
  }
38
39
  return false;
39
40
  }
40
- function zoneArtifactCount(dirPath, zonePath, kind) {
41
- const absolutePath = compiledZoneAbsolutePath(dirPath, { path: zonePath });
41
+ function artifactCount(dirPath, artifactPath, kind) {
42
+ const absolutePath = compiledArtifactAbsolutePath(dirPath, { path: artifactPath });
42
43
  if (!existsSync(absolutePath))
43
44
  return 0;
44
45
  if (kind === "file")
@@ -51,11 +52,11 @@ function summaryAbstract(content) {
51
52
  return null;
52
53
  return extractSynthAbstract(parsed.frontmatter, parsed.body);
53
54
  }
54
- function listZoneArtifacts(dirPath, zone) {
55
- const absolutePath = compiledZoneAbsolutePath(dirPath, zone);
56
- if (!existsSync(absolutePath) || zone.kind === "runtime")
55
+ function listZoneArtifacts(dirPath, artifact) {
56
+ const absolutePath = compiledArtifactAbsolutePath(dirPath, artifact);
57
+ if (!existsSync(absolutePath) || artifact.kind === "runtime")
57
58
  return [];
58
- if (zone.kind === "file") {
59
+ if (artifact.kind === "file") {
59
60
  try {
60
61
  return statSync(absolutePath).isFile() ? [absolutePath] : [];
61
62
  }
@@ -67,8 +68,8 @@ function listZoneArtifacts(dirPath, zone) {
67
68
  }
68
69
  function buildInventoryMetadata(options) {
69
70
  const metadata = {
70
- zone_id: options.zoneId,
71
- zone_kind: options.zoneKind,
71
+ artifact_id: options.artifactId,
72
+ artifact_kind: options.artifactKind,
72
73
  file_extension: extname(options.filePath).toLowerCase() || null,
73
74
  };
74
75
  if (!options.parsedFrontmatter) {
@@ -80,15 +81,16 @@ function buildInventoryMetadata(options) {
80
81
  metadata.abstract = abstract;
81
82
  metadata.abstract_read = true;
82
83
  }
84
+ // Project the standard evidence frontmatter keys onto the inventory
85
+ // metadata. Method authors that emit the canonical evidence keys
86
+ // (`STANDARD_EVIDENCE_FRONTMATTER_KEYS` in contracts) get them
87
+ // surfaced on stage inventory entries; non-standard keys are ignored.
83
88
  const frontmatter = options.parsedFrontmatter.frontmatter;
84
- if (typeof frontmatter.source_kind === "string") {
85
- metadata.source_kind = frontmatter.source_kind;
86
- }
87
- if (typeof frontmatter.evidence_tier === "string") {
88
- metadata.evidence_tier = frontmatter.evidence_tier;
89
- }
90
- if (typeof frontmatter.truth_mode === "string") {
91
- metadata.truth_mode = frontmatter.truth_mode;
89
+ for (const key of STANDARD_EVIDENCE_FRONTMATTER_KEYS) {
90
+ const value = frontmatter[key];
91
+ if (typeof value === "string") {
92
+ metadata[key] = value;
93
+ }
92
94
  }
93
95
  return metadata;
94
96
  }
@@ -96,16 +98,16 @@ function buildStageInventoryEntries(dirPath, stage) {
96
98
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
97
99
  if (!schema)
98
100
  return [];
99
- const readableInputZones = stage.reads
100
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
101
- .filter((zone) => zone !== null && zone.kind !== "runtime");
102
- const outputZones = stage.writes
103
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
104
- .filter((zone) => zone !== null && zone.kind !== "runtime");
105
- if (outputZones.length === 0)
101
+ const readableInputArtifacts = stage.reads
102
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
103
+ .filter((artifact) => artifact !== null && artifact.kind !== "runtime");
104
+ const outputArtifacts = stage.writes
105
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
106
+ .filter((artifact) => artifact !== null && artifact.kind !== "runtime");
107
+ if (outputArtifacts.length === 0)
106
108
  return [];
107
109
  const entries = [];
108
- for (const outputZone of outputZones) {
110
+ for (const outputZone of outputArtifacts) {
109
111
  for (const filePath of listZoneArtifacts(dirPath, outputZone)) {
110
112
  const relativeOutputPath = relative(dirPath, filePath).replaceAll("\\", "/");
111
113
  const parsed = isOutputMarkdownFile(filePath)
@@ -114,36 +116,36 @@ function buildStageInventoryEntries(dirPath, stage) {
114
116
  const sourcePath = typeof parsed?.frontmatter.source === "string"
115
117
  ? parsed.frontmatter.source.trim()
116
118
  : "";
117
- const sourceZoneId = typeof parsed?.frontmatter.source_zone === "string"
118
- ? parsed.frontmatter.source_zone.trim()
119
+ const sourceArtifactId = typeof parsed?.frontmatter.source_artifact === "string"
120
+ ? parsed.frontmatter.source_artifact.trim()
119
121
  : "";
120
- const inputZone = sourceZoneId.length > 0
121
- ? readableInputZones.find((zone) => zone.id === sourceZoneId) ?? null
122
- : readableInputZones.length === 1
123
- ? readableInputZones[0]
122
+ const inputZone = sourceArtifactId.length > 0
123
+ ? readableInputArtifacts.find((artifact) => artifact.id === sourceArtifactId) ?? null
124
+ : readableInputArtifacts.length === 1
125
+ ? readableInputArtifacts[0]
124
126
  : null;
125
127
  entries.push({
126
128
  ...(inputZone && sourcePath.length > 0
127
129
  ? {
128
- input_zone: inputZone.id,
130
+ input_artifact: inputZone.id,
129
131
  input_path: sourcePath,
130
132
  }
131
133
  : {}),
132
- output_zone: outputZone.id,
134
+ output_artifact: outputZone.id,
133
135
  output_path: relativeOutputPath,
134
136
  ...(typeof parsed?.frontmatter.state === "string"
135
137
  ? { state: parsed.frontmatter.state }
136
138
  : {}),
137
139
  metadata: buildInventoryMetadata({
138
- zoneId: outputZone.id,
139
- zoneKind: outputZone.kind,
140
+ artifactId: outputZone.id,
141
+ artifactKind: outputZone.kind,
140
142
  filePath,
141
143
  parsedFrontmatter: parsed,
142
144
  }),
143
145
  });
144
146
  }
145
147
  }
146
- return entries.sort((left, right) => `${left.output_zone}:${left.output_path}`.localeCompare(`${right.output_zone}:${right.output_path}`));
148
+ return entries.sort((left, right) => `${left.output_artifact}:${left.output_path}`.localeCompare(`${right.output_artifact}:${right.output_path}`));
147
149
  }
148
150
  function writeStageInventory(dirPath, stageId, entries) {
149
151
  writeFileSync(join(compiledRuntimeRoot(dirPath), "inventory.json"), JSON.stringify(compiledInventoryFromEntries(entries, stageId), null, 2) + "\n");
@@ -158,12 +160,12 @@ export function reconcileCompiledStageRun(dirPath, stage) {
158
160
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
159
161
  if (!schema)
160
162
  return false;
161
- const writeZones = stage.writes
162
- .map((zoneId) => findCompiledSchemaZone(schema, zoneId))
163
- .filter((zone) => zone !== null);
164
- if (writeZones.length === 0)
163
+ const writeArtifacts = stage.writes
164
+ .map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
165
+ .filter((artifact) => artifact !== null);
166
+ if (writeArtifacts.length === 0)
165
167
  return false;
166
- if (!writeZones.some((zone) => anyPathUpdatedSince(compiledZoneAbsolutePath(dirPath, zone), startedAtMs))) {
168
+ if (!writeArtifacts.some((artifact) => anyPathUpdatedSince(compiledArtifactAbsolutePath(dirPath, artifact), startedAtMs))) {
167
169
  return false;
168
170
  }
169
171
  writeStageInventory(dirPath, stage.id, buildStageInventoryEntries(dirPath, stage));
@@ -181,8 +183,8 @@ export function reconcileCompiledStageRun(dirPath, stage) {
181
183
  started_at: loadRuntimeRun(dirPath)?.started_at ?? now,
182
184
  finished_at: now,
183
185
  counts: activeRunCounts(dirPath),
184
- zone_counts: Object.fromEntries(writeZones.map((zone) => [zone.id, zoneArtifactCount(dirPath, zone.path, zone.kind)])),
185
- artifacts: writeZones.map((zone) => zone.kind === "file" ? zone.path : `${zone.path}/`),
186
+ artifact_counts: Object.fromEntries(writeArtifacts.map((artifact) => [artifact.id, artifactCount(dirPath, artifact.path, artifact.kind)])),
187
+ artifacts: writeArtifacts.map((artifact) => artifact.kind === "file" ? artifact.path : `${artifact.path}/`),
186
188
  summary: loadRuntimeRun(dirPath)?.summary ?? null,
187
189
  run_id: loadRuntimeRun(dirPath)?.run_id ?? null,
188
190
  };
@@ -1,10 +1,9 @@
1
1
  import { type RuntimeRun, type RuntimeStageContract } from "./lib/schema.js";
2
- import { type RuntimeRunPatch, type RuntimeStageExecutionOptions, type RuntimeSummarizeExecutionOptions } from "./runtime-types.js";
2
+ import { type RuntimeRunPatch, type RuntimeStageExecutionOptions } from "./runtime-types.js";
3
3
  export declare function loadRuntimeRun(dirPath: string): RuntimeRun | null;
4
4
  export declare function saveRuntimeRun(dirPath: string, run: RuntimeRun): void;
5
5
  export declare function writeStageContract(dirPath: string, contract: RuntimeStageContract): string;
6
6
  export declare function runExecutorStage(options: RuntimeStageExecutionOptions): Promise<number>;
7
- export declare function runExecutorSummarizeStage(options: RuntimeSummarizeExecutionOptions): Promise<number>;
8
7
  export declare function beginRuntimeRun(dirPath: string, run: RuntimeRun): RuntimeRun;
9
8
  export declare function updateRuntimeRun(dirPath: string, patch: RuntimeRunPatch): RuntimeRun | null;
10
9
  export declare function markRuntimeRunFailedAfterValidation(dirPath: string, summary: string): RuntimeRun | null;
@@ -1,12 +1,10 @@
1
1
  import { appendFileSync, mkdirSync, existsSync, readFileSync, writeFileSync, } from "node:fs";
2
- import { dirname, join, relative } from "node:path";
3
- import chalk from "chalk";
4
- import { countFilesRecursive } from "../shared/filesystem.js";
2
+ import { dirname, relative } from "node:path";
5
3
  import { buildRuntimeExecutorInfo } from "../agents/lib/executors.js";
6
4
  import { RuntimeRunSchema, } from "./lib/schema.js";
7
- import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "../method-package/method-definitions.js";
5
+ import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "../../methods/package/method-definitions.js";
8
6
  import { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
9
- import { warnInterf } from "../shared/logger.js";
7
+ import { warnInterf } from "../../contracts/utils/logger.js";
10
8
  export function loadRuntimeRun(dirPath) {
11
9
  const path = runPath(dirPath);
12
10
  if (!existsSync(path))
@@ -54,44 +52,6 @@ export async function runExecutorStage(options) {
54
52
  finalizeRuntimeRun(options.compiledPath, code);
55
53
  return code;
56
54
  }
57
- export async function runExecutorSummarizeStage(options) {
58
- const startedRun = startRuntimeRun(options);
59
- const prompt = options.buildPrompt(startedRun.activeContractPath);
60
- let lastReported = 0;
61
- writeRuntimeRunPrompt(options.compiledPath, startedRun.run.run_id, prompt);
62
- const executionPath = options.executionPath ?? options.compiledPath;
63
- const progressPromise = options.executor.execute(executionPath, prompt, {
64
- eventLogPath: eventLogPath(options.compiledPath, startedRun.run.run_id),
65
- statusLogPath: statusLogPath(options.compiledPath, startedRun.run.run_id),
66
- completionCheck: options.completionCheck,
67
- onStatus: options.onStatus,
68
- });
69
- const timer = setInterval(() => {
70
- const currentSummaryCount = countFilesRecursive(join(options.compiledPath, "summaries"));
71
- const completed = Math.max(0, Math.min(options.targetCount, currentSummaryCount - options.startingSummaryCount));
72
- if (completed <= lastReported)
73
- return;
74
- lastReported = completed;
75
- updateRuntimeRun(options.compiledPath, {
76
- counts: {
77
- ...startedRun.run.counts,
78
- completed_summaries: completed,
79
- target_summaries: options.targetCount,
80
- },
81
- summary: `${options.stageLabel} ${completed}/${options.targetCount} source files into summaries.`,
82
- });
83
- console.log(chalk.dim(` STATUS: wrote ${completed}/${options.targetCount} summaries`));
84
- options.onStatus?.(`STATUS: wrote ${completed}/${options.targetCount} summaries`);
85
- }, 10000);
86
- try {
87
- const code = await progressPromise;
88
- finalizeRuntimeRun(options.compiledPath, code);
89
- return code;
90
- }
91
- finally {
92
- clearInterval(timer);
93
- }
94
- }
95
55
  export function beginRuntimeRun(dirPath, run) {
96
56
  saveRuntimeRun(dirPath, run);
97
57
  return run;
@@ -169,7 +129,6 @@ function startRuntimeRun(options) {
169
129
  executor: buildRuntimeExecutorInfo(options.executor),
170
130
  instructions: options.contract.instructions,
171
131
  counts: options.contract.counts,
172
- ...(options.contract.acceptance ? { acceptance: options.contract.acceptance } : {}),
173
132
  artifacts: options.contract.artifacts,
174
133
  policies: options.contract.policies,
175
134
  };
@@ -1,6 +1,6 @@
1
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";
2
+ import { type RuntimeRun, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
3
+ import type { Check, MethodId, RuntimeContractType, RuntimeStage } from "../../contracts/lib/schema.js";
4
4
  export type RuntimeRunStatus = "running" | "succeeded" | "failed";
5
5
  export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "method" | "stage" | "stage_label" | "contract_type" | "executor">;
6
6
  export interface RuntimeStageExecutionOptions {
@@ -19,15 +19,6 @@ export interface RuntimeStageExecutionOptions {
19
19
  completionCheck?: (() => boolean) | null;
20
20
  onStatus?: (line: string) => void;
21
21
  }
22
- export interface RuntimeSummarizeExecutionOptions extends RuntimeStageExecutionOptions {
23
- startingSummaryCount: number;
24
- targetCount: number;
25
- }
26
- export interface RuntimeStageAcceptanceValidation {
27
- ok: boolean;
28
- summary: string;
29
- failures: string[];
30
- }
31
22
  export interface RuntimeStageContractOptions {
32
23
  compiledName: string;
33
24
  stageId: string;
@@ -36,10 +27,14 @@ export interface RuntimeStageContractOptions {
36
27
  extraReadArtifacts?: string[];
37
28
  stageReadArtifacts: string[];
38
29
  stageWriteArtifacts: string[];
30
+ stageWriteContracts?: Array<{
31
+ artifact_id: string;
32
+ path: string;
33
+ checks: Check[];
34
+ }>;
39
35
  methodNotes?: string[];
40
36
  localSkillDocs?: string[];
41
37
  instructions: RuntimeStageInstructions;
42
- acceptance?: RuntimeStageAcceptance;
43
38
  }
44
39
  export interface RuntimeRunPatch extends Partial<Pick<RuntimeRun, "counts" | "summary" | "status" | "error" | "exit_code" | "finished_at">> {
45
40
  }
@@ -0,0 +1,5 @@
1
+ export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageContractDraft, RuntimeStageExecutionOptions, RuntimeStageContractOptions, } from "./runtime-types.js";
2
+ export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
3
+ export { buildStagePrompt } from "./runtime-prompt.js";
4
+ export { buildRuntimeStageContract, } from "./runtime-contracts.js";
5
+ export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
@@ -1,5 +1,4 @@
1
1
  export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
2
- export { validateStageContractAcceptance } from "./runtime-acceptance.js";
3
2
  export { buildStagePrompt } from "./runtime-prompt.js";
4
3
  export { buildRuntimeStageContract, } from "./runtime-contracts.js";
5
- export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, runExecutorSummarizeStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
4
+ export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
@@ -1,4 +1,4 @@
1
- import { type SourceFiles, type SourceSnapshot, type StageInputs } from "../contracts/lib/schema.js";
1
+ import { type SourceFiles, type SourceSnapshot, type StageInputs } from "../../contracts/lib/schema.js";
2
2
  export declare function buildCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
3
3
  export declare function writeCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
4
4
  export declare function buildCompiledSourceSnapshot(options: {
@@ -1,11 +1,11 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
3
  import { dirname, resolve } from "node:path";
4
- import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "../contracts/lib/schema.js";
5
- import { readJsonFileWithSchema } from "../shared/parse.js";
4
+ import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "../../contracts/lib/schema.js";
5
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
6
6
  import { discoverSourceFiles } from "./discovery.js";
7
7
  import { compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "./compiled-paths.js";
8
- import { resolveSourceInputPath } from "../project-model/interf-detect.js";
8
+ import { resolveSourceInputPath } from "../../project/interf-detect.js";
9
9
  function shortHash(value, length = 16) {
10
10
  return createHash("sha256")
11
11
  .update(value)