@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
@@ -0,0 +1,194 @@
1
+ /**
2
+ * 0.13 preparation store.
3
+ *
4
+ * Each preparation lives at `~/.interf/preparations/<id>/` and is also
5
+ * registered with the runtime as a synthetic workspace so the existing
6
+ * compile / test / readiness machinery (preparation-keyed under the hood)
7
+ * keeps working without a parallel implementation.
8
+ *
9
+ * ~/.interf/preparations/<id>/
10
+ * interf.json ← preparation config, single preparation entry name=<id>
11
+ * <id>/ ← portable context (matches preparation name)
12
+ *
13
+ * NOTE: We keep the synthetic `interf.json` shape (with a `preparations[]`
14
+ * array of length 1, name=id, path=id) so the existing compile/test
15
+ * machinery stays functional. The doc-shape `config.json` /
16
+ * `portable-context/` from `instance-paths.ts` is aspirational; transitioning
17
+ * the entire compile pipeline to read those names is out of scope for the
18
+ * 0.13 cutover.
19
+ *
20
+ * Public callers reach this through the preparation-keyed HTTP routes.
21
+ */
22
+ import { existsSync, mkdirSync, readdirSync, rmSync, statSync, } from "node:fs";
23
+ import { join, resolve } from "node:path";
24
+ import { PreparationNameSchema, MethodIdSchema, } from "../contracts/lib/schema.js";
25
+ import { preparationDataDir, preparationsRoot, } from "./instance-paths.js";
26
+ import { saveSourceFolderConfig, loadSourceFolderConfig, } from "../project/source-config.js";
27
+ function ensurePreparationsRoot() {
28
+ mkdirSync(preparationsRoot(), { recursive: true });
29
+ }
30
+ function loadStoredPreparation(prepId) {
31
+ const prepDataDir = preparationDataDir(prepId);
32
+ if (!existsSync(prepDataDir) || !statSync(prepDataDir).isDirectory())
33
+ return null;
34
+ const config = loadSourceFolderConfig(prepDataDir);
35
+ if (!config)
36
+ return null;
37
+ const preparation = config.preparations?.find((p) => p.name === prepId);
38
+ if (!preparation)
39
+ return null;
40
+ const sourceFolderPath = config.source_folder?.path;
41
+ if (!sourceFolderPath)
42
+ return null;
43
+ return {
44
+ id: prepId,
45
+ prepDataDir,
46
+ source: { kind: "local-folder", locator: sourceFolderPath },
47
+ methodId: preparation.method ?? null,
48
+ about: preparation.about ?? null,
49
+ config: preparation,
50
+ portableContextPath: join(prepDataDir, prepId),
51
+ configPath: join(prepDataDir, "interf.json"),
52
+ };
53
+ }
54
+ /** List every preparation registered under `~/.interf/preparations/`. */
55
+ export function listStoredPreparations() {
56
+ const root = preparationsRoot();
57
+ if (!existsSync(root))
58
+ return [];
59
+ const entries = readdirSync(root, { withFileTypes: true });
60
+ const out = [];
61
+ for (const entry of entries) {
62
+ if (!entry.isDirectory())
63
+ continue;
64
+ const stored = loadStoredPreparation(entry.name);
65
+ if (stored)
66
+ out.push(stored);
67
+ }
68
+ return out.sort((a, b) => a.id.localeCompare(b.id));
69
+ }
70
+ /** Read one preparation by id. Returns null when missing. */
71
+ export function getStoredPreparation(prepId) {
72
+ return loadStoredPreparation(prepId);
73
+ }
74
+ /**
75
+ * Create a preparation: scaffold its data dir, write the synthetic
76
+ * workspace config, and register it with the runtime so subsequent
77
+ * compile / test / readiness calls find it.
78
+ *
79
+ * Throws on validation errors (bad id, bad method id, source missing).
80
+ */
81
+ export function createStoredPreparation(runtime, input) {
82
+ PreparationNameSchema.parse(input.id);
83
+ if (input.method_id != null) {
84
+ MethodIdSchema.parse(input.method_id);
85
+ }
86
+ const sourceLocator = resolve(input.source.locator);
87
+ if (!existsSync(sourceLocator)) {
88
+ throw new Error(`Source folder does not exist: ${sourceLocator}`);
89
+ }
90
+ if (!statSync(sourceLocator).isDirectory()) {
91
+ throw new Error(`Source folder is not a directory: ${sourceLocator}`);
92
+ }
93
+ ensurePreparationsRoot();
94
+ const prepDataDir = preparationDataDir(input.id);
95
+ if (existsSync(prepDataDir) && loadStoredPreparation(input.id)) {
96
+ throw new Error(`Preparation already exists: ${input.id}`);
97
+ }
98
+ mkdirSync(prepDataDir, { recursive: true });
99
+ const preparation = {
100
+ name: input.id,
101
+ path: input.id,
102
+ ...(input.method_id ? { method: input.method_id } : {}),
103
+ checks: (input.checks ?? []).map((check) => ({
104
+ question: check.question,
105
+ ...(check.answer ? { answer: check.answer } : {}),
106
+ ...(check.strictness ? { strictness: check.strictness } : {}),
107
+ ...(check.expect ? { expect: check.expect } : {}),
108
+ })),
109
+ ...(input.about ? { about: input.about } : {}),
110
+ ...(input.max_attempts ? { max_attempts: input.max_attempts } : {}),
111
+ ...(input.max_loops ? { max_loops: input.max_loops } : {}),
112
+ };
113
+ saveSourceFolderConfig(prepDataDir, {
114
+ source_folder: { path: sourceLocator },
115
+ preparations: [preparation],
116
+ });
117
+ // Hand the synthetic workspace to the runtime so the existing
118
+ // compile/test/readiness paths see it.
119
+ runtime.registerPreparation(prepDataDir);
120
+ const stored = loadStoredPreparation(input.id);
121
+ if (!stored)
122
+ throw new Error(`Failed to load freshly-created preparation ${input.id}`);
123
+ return stored;
124
+ }
125
+ /**
126
+ * Delete a preparation: deregister its synthetic workspace and remove
127
+ * `~/.interf/preparations/<id>/` from disk. Returns true when something
128
+ * was actually removed.
129
+ */
130
+ export function deleteStoredPreparation(runtime, prepId) {
131
+ const prepDataDir = preparationDataDir(prepId);
132
+ if (!existsSync(prepDataDir))
133
+ return false;
134
+ runtime.deregisterPreparation(prepDataDir);
135
+ rmSync(prepDataDir, { recursive: true, force: true });
136
+ return true;
137
+ }
138
+ /**
139
+ * Update mutable fields on an existing preparation (method binding,
140
+ * about text). Returns the freshly-loaded record. Throws if the
141
+ * preparation does not exist.
142
+ */
143
+ export function updateStoredPreparation(prepId, patch) {
144
+ const stored = loadStoredPreparation(prepId);
145
+ if (!stored)
146
+ throw new Error(`Preparation not found: ${prepId}`);
147
+ if (patch.method_id !== undefined && patch.method_id !== null) {
148
+ MethodIdSchema.parse(patch.method_id);
149
+ }
150
+ const nextPreparation = {
151
+ ...stored.config,
152
+ ...(patch.method_id === null
153
+ ? { method: undefined }
154
+ : patch.method_id !== undefined
155
+ ? { method: patch.method_id }
156
+ : {}),
157
+ };
158
+ const aboutPatch = patch.about === undefined ? stored.about : patch.about;
159
+ const preparationWithAbout = aboutPatch
160
+ ? { ...nextPreparation, about: aboutPatch }
161
+ : (() => {
162
+ const { about: _omitAbout, ...rest } = nextPreparation;
163
+ return rest;
164
+ })();
165
+ saveSourceFolderConfig(stored.prepDataDir, {
166
+ source_folder: { path: stored.source.locator },
167
+ preparations: [preparationWithAbout],
168
+ });
169
+ const next = loadStoredPreparation(prepId);
170
+ if (!next)
171
+ throw new Error(`Failed to reload updated preparation ${prepId}`);
172
+ return next;
173
+ }
174
+ /**
175
+ * Re-register every preparation directory with the runtime on startup so
176
+ * synthetic workspaces survive a `interf web` restart.
177
+ */
178
+ export function rehydratePreparations(runtime) {
179
+ for (const stored of listStoredPreparations()) {
180
+ runtime.registerPreparation(stored.prepDataDir);
181
+ }
182
+ }
183
+ /** Build the wire shape for `GET /v1/preparations/<id>` given a stored preparation. */
184
+ export function preparationWireShape(stored) {
185
+ return {
186
+ id: stored.id,
187
+ source: stored.source,
188
+ method_id: stored.methodId,
189
+ about: stored.about,
190
+ config_path: stored.configPath,
191
+ portable_context: { kind: "local-path", value: stored.portableContextPath },
192
+ checks: stored.config.checks ?? [],
193
+ };
194
+ }
@@ -1,5 +1,5 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import type { SourceReadinessCheck } from "../project-model/lib/schema.js";
1
+ import type { MethodExecutor } from "./agents/lib/executors.js";
2
+ import type { SourceReadinessCheck } from "../project/lib/schema.js";
3
3
  export declare function buildReadinessCheckDraftPrompt(options: {
4
4
  preparationName: string;
5
5
  sourceFolderPath: string;
@@ -0,0 +1,78 @@
1
+ export declare const LOCAL_SERVICE_DEFAULT_HOST = "127.0.0.1";
2
+ export declare const LOCAL_SERVICE_DEFAULT_PORT = 4873;
3
+ export declare const LOCAL_SERVICE_ROUTES: {
4
+ readonly root: "/";
5
+ readonly api: "/v1";
6
+ readonly health: "/health";
7
+ readonly instance: "/v1/instance";
8
+ readonly preparations: "/v1/preparations";
9
+ readonly methods: "/v1/methods";
10
+ readonly runs: "/v1/runs";
11
+ readonly actionProposals: "/v1/action-proposals";
12
+ /**
13
+ * 0.14 single-active-agent shortcut. Kept as a back-compat shim
14
+ * over the role-map's `general` row in 0.15+.
15
+ */
16
+ readonly executor: "/v1/executor";
17
+ /**
18
+ * 0.15 connected-agents primitive — registry, role-map, role list.
19
+ * `agents/{name}` and `agents/role-map` are sub-resources handled
20
+ * by string match in `server.ts`.
21
+ */
22
+ readonly agents: "/v1/agents";
23
+ readonly openPath: "/v1/open-path";
24
+ };
25
+ /** Preparation-scoped sub-resources (relative to /v1/preparations/<id>/). */
26
+ export declare const PREPARATION_SUBRESOURCES: {
27
+ readonly compileRuns: "compile-runs";
28
+ readonly verifyRuns: "verify-runs";
29
+ readonly methodAuthoringRuns: "method-authoring-runs";
30
+ readonly methodImprovementRuns: "method-improvement-runs";
31
+ readonly readinessCheckDrafts: "readiness-check-drafts";
32
+ readonly changes: "changes";
33
+ readonly reset: "reset";
34
+ readonly runs: "runs";
35
+ readonly readiness: "readiness";
36
+ readonly sourceFiles: "source-files";
37
+ readonly portableContext: "portable-context";
38
+ /**
39
+ * 0.16 — read a portable-context file (read-only, path-guarded
40
+ * inside the prep's portable-context root). Used by the locator
41
+ * pattern's `api-served` kind:
42
+ * GET /v1/preparations/<id>/files/<relpath>
43
+ */
44
+ readonly files: "files";
45
+ };
46
+ /** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
47
+ export declare const METHOD_SUBRESOURCES: {
48
+ readonly runs: "runs";
49
+ /**
50
+ * 0.16 — read a method package file (read-only, path-guarded inside
51
+ * the method root). Used by the locator pattern's `api-served` kind:
52
+ * GET /v1/methods/<id>/files/<relpath>
53
+ */
54
+ readonly files: "files";
55
+ };
56
+ /** Run-scoped sub-resources (relative to /v1/runs/<run-id>/). */
57
+ export declare const RUN_SUBRESOURCES: {
58
+ readonly events: "events";
59
+ readonly cancel: "cancel";
60
+ readonly proof: "proof";
61
+ readonly artifacts: "artifacts";
62
+ };
63
+ export declare function buildLocalServiceUrl(options?: {
64
+ host?: string;
65
+ port?: number;
66
+ }): string;
67
+ /** Path builder: /v1/preparations/<id>. */
68
+ export declare function preparationResourcePath(prepId: string): string;
69
+ /** Path builder: /v1/preparations/<id>/<subresource>. */
70
+ export declare function preparationSubresourcePath(prepId: string, sub: keyof typeof PREPARATION_SUBRESOURCES): string;
71
+ /** Path builder: /v1/runs/<run-id>. */
72
+ export declare function runResourcePath(runId: string): string;
73
+ /** Path builder: /v1/runs/<run-id>/<subresource>. */
74
+ export declare function runSubresourcePath(runId: string, sub: keyof typeof RUN_SUBRESOURCES): string;
75
+ /** Path builder: /v1/methods/<id>. */
76
+ export declare function methodResourcePath(methodId: string): string;
77
+ /** Path builder: /v1/methods/<id>/<subresource>. */
78
+ export declare function methodSubresourcePath(methodId: string, sub: keyof typeof METHOD_SUBRESOURCES): string;
@@ -0,0 +1,92 @@
1
+ export const LOCAL_SERVICE_DEFAULT_HOST = "127.0.0.1";
2
+ export const LOCAL_SERVICE_DEFAULT_PORT = 4873;
3
+ export const LOCAL_SERVICE_ROUTES = {
4
+ root: "/",
5
+ api: "/v1",
6
+ health: "/health",
7
+ // 0.13 surface — preparation-keyed.
8
+ instance: "/v1/instance",
9
+ preparations: "/v1/preparations",
10
+ methods: "/v1/methods",
11
+ runs: "/v1/runs",
12
+ actionProposals: "/v1/action-proposals",
13
+ /**
14
+ * 0.14 single-active-agent shortcut. Kept as a back-compat shim
15
+ * over the role-map's `general` row in 0.15+.
16
+ */
17
+ executor: "/v1/executor",
18
+ /**
19
+ * 0.15 connected-agents primitive — registry, role-map, role list.
20
+ * `agents/{name}` and `agents/role-map` are sub-resources handled
21
+ * by string match in `server.ts`.
22
+ */
23
+ agents: "/v1/agents",
24
+ openPath: "/v1/open-path",
25
+ };
26
+ /** Preparation-scoped sub-resources (relative to /v1/preparations/<id>/). */
27
+ export const PREPARATION_SUBRESOURCES = {
28
+ compileRuns: "compile-runs",
29
+ verifyRuns: "verify-runs",
30
+ methodAuthoringRuns: "method-authoring-runs",
31
+ methodImprovementRuns: "method-improvement-runs",
32
+ readinessCheckDrafts: "readiness-check-drafts",
33
+ changes: "changes",
34
+ reset: "reset",
35
+ runs: "runs",
36
+ readiness: "readiness",
37
+ sourceFiles: "source-files",
38
+ portableContext: "portable-context",
39
+ /**
40
+ * 0.16 — read a portable-context file (read-only, path-guarded
41
+ * inside the prep's portable-context root). Used by the locator
42
+ * pattern's `api-served` kind:
43
+ * GET /v1/preparations/<id>/files/<relpath>
44
+ */
45
+ files: "files",
46
+ };
47
+ /** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
48
+ export const METHOD_SUBRESOURCES = {
49
+ runs: "runs",
50
+ /**
51
+ * 0.16 — read a method package file (read-only, path-guarded inside
52
+ * the method root). Used by the locator pattern's `api-served` kind:
53
+ * GET /v1/methods/<id>/files/<relpath>
54
+ */
55
+ files: "files",
56
+ };
57
+ /** Run-scoped sub-resources (relative to /v1/runs/<run-id>/). */
58
+ export const RUN_SUBRESOURCES = {
59
+ events: "events",
60
+ cancel: "cancel",
61
+ proof: "proof",
62
+ artifacts: "artifacts",
63
+ };
64
+ export function buildLocalServiceUrl(options = {}) {
65
+ const host = options.host ?? LOCAL_SERVICE_DEFAULT_HOST;
66
+ const port = options.port ?? LOCAL_SERVICE_DEFAULT_PORT;
67
+ return `http://${host}:${port}`;
68
+ }
69
+ /** Path builder: /v1/preparations/<id>. */
70
+ export function preparationResourcePath(prepId) {
71
+ return `${LOCAL_SERVICE_ROUTES.preparations}/${encodeURIComponent(prepId)}`;
72
+ }
73
+ /** Path builder: /v1/preparations/<id>/<subresource>. */
74
+ export function preparationSubresourcePath(prepId, sub) {
75
+ return `${preparationResourcePath(prepId)}/${PREPARATION_SUBRESOURCES[sub]}`;
76
+ }
77
+ /** Path builder: /v1/runs/<run-id>. */
78
+ export function runResourcePath(runId) {
79
+ return `${LOCAL_SERVICE_ROUTES.runs}/${encodeURIComponent(runId)}`;
80
+ }
81
+ /** Path builder: /v1/runs/<run-id>/<subresource>. */
82
+ export function runSubresourcePath(runId, sub) {
83
+ return `${runResourcePath(runId)}/${RUN_SUBRESOURCES[sub]}`;
84
+ }
85
+ /** Path builder: /v1/methods/<id>. */
86
+ export function methodResourcePath(methodId) {
87
+ return `${LOCAL_SERVICE_ROUTES.methods}/${encodeURIComponent(methodId)}`;
88
+ }
89
+ /** Path builder: /v1/methods/<id>/<subresource>. */
90
+ export function methodSubresourcePath(methodId, sub) {
91
+ return `${methodResourcePath(methodId)}/${METHOD_SUBRESOURCES[sub]}`;
92
+ }
@@ -1,6 +1,6 @@
1
- import { type ArtifactRef, type CompileRun } from "../execution/lib/schema.js";
2
- import { type LocalJobRunResource, type RunObservabilityResource, type TestRunResource } from "./lib/schema.js";
1
+ import { type ArtifactRef, type CompileRun } from "./execution/lib/schema.js";
2
+ import { type LocalJobRunResource, type RunObservabilityResource, type VerifyRunResource } from "./lib/schema.js";
3
3
  export declare function uniqueArtifacts(artifacts: ArtifactRef[]): ArtifactRef[];
4
4
  export declare function compileRunToObservability(run: CompileRun): RunObservabilityResource;
5
- export declare function testRunToObservability(run: TestRunResource): RunObservabilityResource;
5
+ export declare function verifyRunToObservability(run: VerifyRunResource): RunObservabilityResource;
6
6
  export declare function jobRunToObservability(job: LocalJobRunResource): RunObservabilityResource;
@@ -1,4 +1,4 @@
1
- import { createRunEventTimestamp, } from "../execution/events.js";
1
+ import { createRunEventTimestamp, } from "./execution/events.js";
2
2
  import { RunObservabilityResourceSchema, } from "./lib/schema.js";
3
3
  export function uniqueArtifacts(artifacts) {
4
4
  const seen = new Set();
@@ -268,23 +268,23 @@ export function compileRunToObservability(run) {
268
268
  },
269
269
  });
270
270
  }
271
- export function testRunToObservability(run) {
271
+ export function verifyRunToObservability(run) {
272
272
  const traceStatus = methodTraceRunStatus(run.status);
273
273
  const title = `Check readiness ${run.preparation}`;
274
- const methodName = interfTraceName("test", title);
274
+ const methodName = interfTraceName("verify", title);
275
275
  const completedAt = run.finished_at ?? (traceStatus === "completed" || traceStatus === "failed" || traceStatus === "cancelled"
276
276
  ? run.started_at ?? new Date().toISOString()
277
277
  : undefined);
278
278
  const readinessRun = run.readiness_run;
279
- const raw = readinessRun?.raw ?? null;
279
+ const sourceFiles = readinessRun?.source_files ?? null;
280
280
  const compiled = readinessRun?.compiled ?? null;
281
281
  const proofCandidates = [
282
- raw
282
+ sourceFiles
283
283
  ? {
284
284
  id: `${run.run_id}-source-files`,
285
285
  label: "source files baseline",
286
- ok: raw.ok ?? raw.passed_cases === raw.total_cases,
287
- detail: `${raw.passed_cases}/${raw.total_cases} checks`,
286
+ ok: sourceFiles.ok ?? sourceFiles.passed_cases === sourceFiles.total_cases,
287
+ detail: `${sourceFiles.passed_cases}/${sourceFiles.total_cases} checks`,
288
288
  }
289
289
  : null,
290
290
  compiled
@@ -298,7 +298,7 @@ export function testRunToObservability(run) {
298
298
  ];
299
299
  const proof = proofCandidates.filter((value) => value !== null);
300
300
  const artifacts = uniqueArtifacts([
301
- ...(raw?.run_path ? [{ path: raw.run_path, role: "test", label: "source files readiness run" }] : []),
301
+ ...(sourceFiles?.run_path ? [{ path: sourceFiles.run_path, role: "test", label: "source files readiness run" }] : []),
302
302
  ...(compiled?.run_path ? [{ path: compiled.run_path, role: "test", label: "portable context readiness run" }] : []),
303
303
  ]);
304
304
  let eventIndex = 0;
@@ -307,9 +307,10 @@ export function testRunToObservability(run) {
307
307
  deploymentId: "local-interf",
308
308
  methodName,
309
309
  input: {
310
- kind: "test",
310
+ kind: "verify",
311
311
  preparation: run.preparation,
312
- mode: run.mode,
312
+ // 0.15 — verify runs always judge against compiled output.
313
+ mode: "compiled",
313
314
  },
314
315
  }),
315
316
  ];
@@ -318,18 +319,18 @@ export function testRunToObservability(run) {
318
319
  methodName,
319
320
  input: {
320
321
  preparation: run.preparation,
321
- mode: run.mode,
322
+ mode: "compiled",
322
323
  },
323
324
  }));
324
325
  }
325
326
  const targetStepCandidates = [
326
- raw
327
+ sourceFiles
327
328
  ? {
328
329
  id: "source-files-baseline",
329
330
  label: "Source files baseline",
330
- status: raw.ok ?? raw.passed_cases === raw.total_cases ? "succeeded" : "failed",
331
- input: raw.target ?? { type: "source-files", path: run.source_path ?? null },
332
- output: raw,
331
+ status: sourceFiles.ok ?? sourceFiles.passed_cases === sourceFiles.total_cases ? "succeeded" : "failed",
332
+ input: sourceFiles.target ?? { type: "source-files", path: run.source_path ?? null },
333
+ output: sourceFiles,
333
334
  }
334
335
  : null,
335
336
  compiled
@@ -350,7 +351,7 @@ export function testRunToObservability(run) {
350
351
  status: run.status === "failed" ? "failed" : "succeeded",
351
352
  input: {
352
353
  preparation: run.preparation,
353
- mode: run.mode,
354
+ mode: "compiled",
354
355
  },
355
356
  output: readinessRun ?? null,
356
357
  });
@@ -358,7 +359,7 @@ export function testRunToObservability(run) {
358
359
  for (const step of targetSteps) {
359
360
  const timestamp = run.started_at ?? run.finished_at ?? new Date().toISOString();
360
361
  events.push(traceEvent(run.run_id, "step_created", timestamp, eventIndex++, {
361
- stepName: methodStepName("test", step.label),
362
+ stepName: methodStepName("verify", step.label),
362
363
  input: step.input,
363
364
  }, step.id));
364
365
  events.push(traceEvent(run.run_id, "step_started", timestamp, eventIndex++, {
@@ -388,7 +389,7 @@ export function testRunToObservability(run) {
388
389
  kind: "interf-run-observability",
389
390
  version: 1,
390
391
  run_id: run.run_id,
391
- run_type: "test",
392
+ run_type: "verify",
392
393
  title,
393
394
  status: observableRunStatus(run.status),
394
395
  preparation: run.preparation,
@@ -401,9 +402,9 @@ export function testRunToObservability(run) {
401
402
  readiness: run.readiness ?? null,
402
403
  metrics: [
403
404
  { label: "Preparation", value: run.preparation },
404
- { label: "Mode", value: run.mode },
405
- { label: "Readiness checks", value: compiled ? `${compiled.passed_cases}/${compiled.total_cases}` : raw ? `${raw.passed_cases}/${raw.total_cases}` : "0/0" },
406
- { label: "Source files", value: raw ? `${raw.passed_cases}/${raw.total_cases}` : "-" },
405
+ { label: "Mode", value: "compiled" },
406
+ { label: "Readiness checks", value: compiled ? `${compiled.passed_cases}/${compiled.total_cases}` : sourceFiles ? `${sourceFiles.passed_cases}/${sourceFiles.total_cases}` : "0/0" },
407
+ { label: "Source files", value: sourceFiles ? `${sourceFiles.passed_cases}/${sourceFiles.total_cases}` : "-" },
407
408
  { label: "Portable context", value: compiled ? `${compiled.passed_cases}/${compiled.total_cases}` : "-" },
408
409
  ],
409
410
  artifacts,
@@ -417,13 +418,13 @@ export function testRunToObservability(run) {
417
418
  specVersion: 1,
418
419
  executionContext: {
419
420
  product: "Interf",
420
- run_type: "test",
421
+ run_type: "verify",
421
422
  preparation: run.preparation,
422
- mode: run.mode,
423
+ mode: "compiled",
423
424
  },
424
425
  input: {
425
426
  preparation: run.preparation,
426
- mode: run.mode,
427
+ mode: "compiled",
427
428
  source_path: run.source_path ?? null,
428
429
  portable_context_path: run.portable_context_path ?? null,
429
430
  },
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Runtime read-side caches.
3
+ *
4
+ * The local service runtime fronts a filesystem-backed model: every
5
+ * "list" or "get" call walks `.interf/runtime/...`, parses each JSON
6
+ * record through Zod, and returns the typed shape. Polling clients
7
+ * (Compiler UI, CLI status loops) hit those endpoints multiple times
8
+ * per second; on workspaces with hundreds of compile / test runs this
9
+ * shows up as the dominant CPU cost.
10
+ *
11
+ * The caches here memoize the parsed-and-validated results. Each cache
12
+ * is per-workspace so multi-workspace runtimes do not cross-pollinate,
13
+ * and each cache exposes both a read path (`get(...)`) and an explicit
14
+ * invalidation hook (`invalidate(...)`). The runtime calls
15
+ * `invalidate*` whenever it writes, so the next read repopulates from
16
+ * disk. Invalidation is intentionally broad (per-preparation, not
17
+ * per-record) — staleness is the only correctness bug worth avoiding,
18
+ * and per-record invalidation introduces fan-out without measurably
19
+ * lowering recompute cost.
20
+ */
21
+ /**
22
+ * Per-(workspace, preparation) cache for compile run records, plus a
23
+ * runId -> preparation index so `getCompileRun(runId)` can resolve to
24
+ * the owning preparation without scanning every preparation's runs.
25
+ */
26
+ export declare class RunListingCache<TRecord> {
27
+ /** prepDataDir -> preparation -> records (newest-first sorted). */
28
+ private byWorkspace;
29
+ /** prepDataDir -> runId -> preparation. */
30
+ private runIndex;
31
+ get(prepDataDir: string, preparation: string, fill: () => TRecord[], runIdOf: (record: TRecord) => string): TRecord[];
32
+ /** Look up which preparation owns this runId, if known. */
33
+ preparationFor(prepDataDir: string, runId: string): string | null;
34
+ /** Invalidate a single preparation's cached records and id index. */
35
+ invalidatePreparation(prepDataDir: string, preparation: string): void;
36
+ /** Drop everything for a workspace (e.g. after a reset). */
37
+ invalidateWorkspace(prepDataDir: string): void;
38
+ }
39
+ /**
40
+ * Per-(workspace, preparation) readiness cache. Readiness joins compile
41
+ * runs, test runs, readiness-check runs, and the preparation config; it
42
+ * is computed on every poll. The cache invalidates when the runtime
43
+ * writes any of those underlying objects for a given preparation.
44
+ */
45
+ export declare class ReadinessCache<TReadiness> {
46
+ private byWorkspace;
47
+ get(prepDataDir: string, preparation: string, compute: () => TReadiness): TReadiness;
48
+ invalidatePreparation(prepDataDir: string, preparation: string): void;
49
+ invalidateWorkspace(prepDataDir: string): void;
50
+ }
51
+ /**
52
+ * Source-folder listing cache keyed by `(cacheKey, folderRootMtime)`.
53
+ * `cacheKey` is the slot identifier; `folderPath` is the directory the
54
+ * cache stats for an mtime probe. UI polling is the hot path; CLI
55
+ * commands rarely hit the same path twice in <2s, hence the short TTL
56
+ * fallback.
57
+ */
58
+ export declare class MtimeListingCache<TList> {
59
+ private static readonly TTL_MS;
60
+ private cache;
61
+ get(cacheKey: string, folderPath: string, fill: () => TList): TList;
62
+ invalidate(cacheKey: string): void;
63
+ invalidateAll(): void;
64
+ }
65
+ /**
66
+ * Method-package listing cache keyed by the joined mtimes of the
67
+ * builtin / user / workspace method roots. If any of those ticks (a
68
+ * new local Method, an edit to the user library, etc.) the cache
69
+ * misses and we re-resolve.
70
+ */
71
+ export declare class MethodListingCache<TList> {
72
+ private cache;
73
+ get(cacheKey: string, rootPaths: string[], fill: () => TList): TList;
74
+ invalidate(cacheKey: string): void;
75
+ invalidateAll(): void;
76
+ }