mayura 1.2.0 → 1.2.2

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 (409) hide show
  1. package/README.md +2 -0
  2. package/docs/README.md +17 -4
  3. package/docs/cli/init.md +15 -3
  4. package/docs/concepts/workflows.md +60 -1
  5. package/docs/guides/choosing-a-starter.md +80 -0
  6. package/docs/guides/durable-workflows.md +1 -1
  7. package/docs/guides/framework-starters.md +5 -1
  8. package/docs/guides/hono.md +94 -0
  9. package/docs/guides/nextjs.md +94 -0
  10. package/docs/guides/nuxt.md +94 -0
  11. package/docs/guides/rag-deployment.md +48 -0
  12. package/docs/guides/rag-modal-pinecone-starter.md +63 -0
  13. package/docs/guides/rag-production.md +48 -0
  14. package/docs/guides/rag-quickstart.md +119 -0
  15. package/docs/guides/rag.md +23 -3
  16. package/docs/guides/react-router.md +94 -0
  17. package/docs/guides/release-readiness.md +78 -55
  18. package/docs/guides/sveltekit.md +94 -0
  19. package/docs/guides/tanstack-start.md +94 -0
  20. package/docs/guides/workflow-composition.md +1 -1
  21. package/docs/integrations/reranker-cohere.md +1 -0
  22. package/docs/integrations/reranker-jina.md +1 -0
  23. package/docs/integrations/reranker-voyage.md +1 -0
  24. package/docs/integrations/vector-chroma.md +1 -0
  25. package/docs/integrations/vector-libsql.md +1 -0
  26. package/docs/integrations/vector-pgvector.md +1 -0
  27. package/docs/integrations/vector-pinecone.md +4 -1
  28. package/docs/integrations/vector-qdrant.md +1 -0
  29. package/docs/integrations/vector-weaviate.md +1 -0
  30. package/docs/introduction.md +5 -0
  31. package/docs/project/whats-new.md +70 -2
  32. package/docs/quickstart.md +5 -3
  33. package/lib/adapter-code-docker/image/Dockerfile +1 -1
  34. package/lib/adapter-code-docker/package.json +1 -1
  35. package/lib/adapter-code-quickjs/package.json +1 -1
  36. package/lib/adapter-mcp/package.json +1 -1
  37. package/lib/ag-ui/package.json +1 -1
  38. package/lib/artifacts/package.json +1 -1
  39. package/lib/auth/package.json +1 -1
  40. package/lib/authz/package.json +1 -1
  41. package/lib/browser/package.json +1 -1
  42. package/lib/cli/dist/index.d.ts +1 -1
  43. package/lib/cli/dist/index.d.ts.map +1 -1
  44. package/lib/cli/dist/index.js +63 -20
  45. package/lib/cli/dist/index.js.map +1 -1
  46. package/lib/cli/dist/interactive.js +2 -2
  47. package/lib/cli/dist/interactive.js.map +1 -1
  48. package/lib/cli/dist/operations.d.ts +1 -0
  49. package/lib/cli/dist/operations.d.ts.map +1 -1
  50. package/lib/cli/dist/operations.js +13 -5
  51. package/lib/cli/dist/operations.js.map +1 -1
  52. package/lib/cli/package.json +1 -1
  53. package/lib/cli/src/index.ts +51 -12
  54. package/lib/cli/src/interactive.ts +2 -2
  55. package/lib/cli/src/operations.ts +9 -5
  56. package/lib/cli/starter-assets/manifest.json +1 -0
  57. package/lib/cli/starters/hono/package.json +2 -2
  58. package/lib/cli/starters/rag-modal-pinecone/README.md +60 -0
  59. package/lib/cli/starters/rag-modal-pinecone/dot-env.example +23 -0
  60. package/lib/cli/starters/{event-automation → rag-modal-pinecone}/dot-gitignore +2 -4
  61. package/lib/cli/starters/rag-modal-pinecone/fixtures/on-call.md +4 -0
  62. package/lib/cli/starters/rag-modal-pinecone/mayura.project.json +13 -0
  63. package/lib/cli/starters/rag-modal-pinecone/modal-app.py +110 -0
  64. package/lib/cli/starters/rag-modal-pinecone/package.json +28 -0
  65. package/lib/cli/starters/rag-modal-pinecone/src/application.ts +148 -0
  66. package/lib/cli/starters/rag-modal-pinecone/src/cli.ts +78 -0
  67. package/lib/cli/starters/rag-modal-pinecone/src/hosted.ts +137 -0
  68. package/lib/cli/starters/rag-modal-pinecone/test/modal_worker_test.py +53 -0
  69. package/lib/cli/starters/rag-modal-pinecone/test/pipeline.test.ts +137 -0
  70. package/lib/cli/starters/{cli-agent → rag-modal-pinecone}/tsconfig.json +0 -1
  71. package/lib/client/dist/index.d.ts.map +1 -1
  72. package/lib/client/dist/index.js +12 -4
  73. package/lib/client/dist/index.js.map +1 -1
  74. package/lib/client/dist/workflow-limits.d.ts +6 -0
  75. package/lib/client/dist/workflow-limits.d.ts.map +1 -0
  76. package/lib/client/dist/workflow-limits.js +15 -0
  77. package/lib/client/dist/workflow-limits.js.map +1 -0
  78. package/lib/client/dist/workflows.d.ts +3 -0
  79. package/lib/client/dist/workflows.d.ts.map +1 -1
  80. package/lib/client/dist/workflows.js +15 -7
  81. package/lib/client/dist/workflows.js.map +1 -1
  82. package/lib/client/package.json +1 -1
  83. package/lib/client/src/index.ts +7 -4
  84. package/lib/client/src/workflow-limits.ts +12 -0
  85. package/lib/client/src/workflows.ts +12 -6
  86. package/lib/client-react/package.json +1 -1
  87. package/lib/code-mode/package.json +1 -1
  88. package/lib/code-mode-workflows/package.json +1 -1
  89. package/lib/context/package.json +1 -1
  90. package/lib/core/dist/host.d.ts +1 -0
  91. package/lib/core/dist/host.d.ts.map +1 -1
  92. package/lib/core/dist/host.js +1 -0
  93. package/lib/core/dist/host.js.map +1 -1
  94. package/lib/core/dist/index.d.ts +1 -0
  95. package/lib/core/dist/index.d.ts.map +1 -1
  96. package/lib/core/dist/index.js +1 -0
  97. package/lib/core/dist/index.js.map +1 -1
  98. package/lib/core/dist/workflow-environment.d.ts +9 -0
  99. package/lib/core/dist/workflow-environment.d.ts.map +1 -0
  100. package/lib/core/dist/workflow-environment.js +15 -0
  101. package/lib/core/dist/workflow-environment.js.map +1 -0
  102. package/lib/core/dist/workflow-limits.d.ts +7 -0
  103. package/lib/core/dist/workflow-limits.d.ts.map +1 -0
  104. package/lib/core/dist/workflow-limits.js +17 -0
  105. package/lib/core/dist/workflow-limits.js.map +1 -0
  106. package/lib/core/package.json +1 -1
  107. package/lib/core/src/host.ts +1 -0
  108. package/lib/core/src/index.ts +1 -0
  109. package/lib/core/src/workflow-environment.ts +15 -0
  110. package/lib/core/src/workflow-limits.ts +16 -0
  111. package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
  112. package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
  113. package/lib/exporter-otlp/dist/signals.js +2 -2
  114. package/lib/exporter-otlp/dist/signals.js.map +1 -1
  115. package/lib/exporter-otlp/package.json +1 -1
  116. package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
  117. package/lib/exporter-otlp/src/signals.ts +2 -2
  118. package/lib/files/package.json +1 -1
  119. package/lib/guardrails/package.json +1 -1
  120. package/lib/helpers/package.json +1 -1
  121. package/lib/keys/package.json +1 -1
  122. package/lib/memory/package.json +1 -1
  123. package/lib/memory-remote/package.json +1 -1
  124. package/lib/observability/package.json +1 -1
  125. package/lib/provider-anthropic/package.json +1 -1
  126. package/lib/provider-openai/package.json +1 -1
  127. package/lib/rag/dist/bm25.d.ts +13 -0
  128. package/lib/rag/dist/bm25.d.ts.map +1 -0
  129. package/lib/rag/dist/bm25.js +76 -0
  130. package/lib/rag/dist/bm25.js.map +1 -0
  131. package/lib/rag/dist/document-lexical.d.ts +7 -0
  132. package/lib/rag/dist/document-lexical.d.ts.map +1 -0
  133. package/lib/rag/dist/document-lexical.js +33 -0
  134. package/lib/rag/dist/document-lexical.js.map +1 -0
  135. package/lib/rag/dist/evidence-window.d.ts +15 -0
  136. package/lib/rag/dist/evidence-window.d.ts.map +1 -0
  137. package/lib/rag/dist/evidence-window.js +52 -0
  138. package/lib/rag/dist/evidence-window.js.map +1 -0
  139. package/lib/rag/dist/retrieval.d.ts +6 -0
  140. package/lib/rag/dist/retrieval.d.ts.map +1 -1
  141. package/lib/rag/dist/retrieval.js +60 -6
  142. package/lib/rag/dist/retrieval.js.map +1 -1
  143. package/lib/rag/dist/vectors.d.ts +8 -0
  144. package/lib/rag/dist/vectors.d.ts.map +1 -1
  145. package/lib/rag/dist/vectors.js +121 -4
  146. package/lib/rag/dist/vectors.js.map +1 -1
  147. package/lib/rag/package.json +1 -1
  148. package/lib/rag/src/bm25.ts +35 -0
  149. package/lib/rag/src/document-lexical.ts +17 -0
  150. package/lib/rag/src/evidence-window.ts +41 -0
  151. package/lib/rag/src/retrieval.ts +56 -7
  152. package/lib/rag/src/vectors.ts +62 -4
  153. package/lib/runtime/package.json +1 -1
  154. package/lib/sandbox/package.json +1 -1
  155. package/lib/sdk/package.json +1 -1
  156. package/lib/server/dist/index.d.ts +2 -0
  157. package/lib/server/dist/index.d.ts.map +1 -1
  158. package/lib/server/dist/index.js +12 -4
  159. package/lib/server/dist/index.js.map +1 -1
  160. package/lib/server/dist/inspector-bundle.d.ts +1 -1
  161. package/lib/server/dist/inspector-bundle.d.ts.map +1 -1
  162. package/lib/server/dist/inspector-bundle.js +4 -4
  163. package/lib/server/dist/inspector-bundle.js.map +1 -1
  164. package/lib/server/package.json +1 -1
  165. package/lib/server/src/index.ts +9 -4
  166. package/lib/server/src/inspector-bundle.ts +4 -4
  167. package/lib/server-node/package.json +1 -1
  168. package/lib/skills/package.json +1 -1
  169. package/lib/storage/package.json +1 -1
  170. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +2 -0
  171. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -1
  172. package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -1
  173. package/lib/storage-contracts/dist/workflow-format2.d.ts +2 -0
  174. package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -1
  175. package/lib/storage-contracts/dist/workflow-format2.js +8 -7
  176. package/lib/storage-contracts/dist/workflow-format2.js.map +1 -1
  177. package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -1
  178. package/lib/storage-contracts/dist/workflow-format3.js +9 -7
  179. package/lib/storage-contracts/dist/workflow-format3.js.map +1 -1
  180. package/lib/storage-contracts/dist/workflow-format4.d.ts +2 -0
  181. package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -1
  182. package/lib/storage-contracts/dist/workflow-format4.js +9 -8
  183. package/lib/storage-contracts/dist/workflow-format4.js.map +1 -1
  184. package/lib/storage-contracts/dist/workflow-format5.d.ts +4 -0
  185. package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -1
  186. package/lib/storage-contracts/dist/workflow-format5.js +9 -8
  187. package/lib/storage-contracts/dist/workflow-format5.js.map +1 -1
  188. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +2 -0
  189. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -1
  190. package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -1
  191. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +2 -0
  192. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -1
  193. package/lib/storage-contracts/dist/workflow-tree-contracts.js +5 -3
  194. package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -1
  195. package/lib/storage-contracts/package.json +1 -1
  196. package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +2 -0
  197. package/lib/storage-contracts/src/workflow-format2.ts +10 -7
  198. package/lib/storage-contracts/src/workflow-format3.ts +9 -7
  199. package/lib/storage-contracts/src/workflow-format4.ts +11 -8
  200. package/lib/storage-contracts/src/workflow-format5.ts +13 -8
  201. package/lib/storage-contracts/src/workflow-graph-contracts.ts +2 -0
  202. package/lib/storage-contracts/src/workflow-tree-contracts.ts +7 -3
  203. package/lib/storage-postgres/package.json +1 -1
  204. package/lib/storage-sql/dist/scheduled-database.js +1 -1
  205. package/lib/storage-sql/dist/scheduled-database.js.map +1 -1
  206. package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -1
  207. package/lib/storage-sql/dist/workflow-tree-database.js +37 -1
  208. package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -1
  209. package/lib/storage-sql/package.json +1 -1
  210. package/lib/storage-sql/src/scheduled-database.ts +1 -1
  211. package/lib/storage-sql/src/workflow-tree-database.ts +15 -1
  212. package/lib/storage-sqlite/package.json +1 -1
  213. package/lib/terminal/package.json +1 -1
  214. package/lib/testing/package.json +1 -1
  215. package/lib/threads/package.json +1 -1
  216. package/lib/tools/package.json +1 -1
  217. package/lib/voice/package.json +1 -1
  218. package/lib/workflows/dist/children-definition.d.ts +5 -1
  219. package/lib/workflows/dist/children-definition.d.ts.map +1 -1
  220. package/lib/workflows/dist/children-definition.js +6 -2
  221. package/lib/workflows/dist/children-definition.js.map +1 -1
  222. package/lib/workflows/dist/children-runtime.d.ts.map +1 -1
  223. package/lib/workflows/dist/children-runtime.js +4 -3
  224. package/lib/workflows/dist/children-runtime.js.map +1 -1
  225. package/lib/workflows/dist/definition.d.ts +4 -0
  226. package/lib/workflows/dist/definition.d.ts.map +1 -1
  227. package/lib/workflows/dist/definition.js +6 -3
  228. package/lib/workflows/dist/definition.js.map +1 -1
  229. package/lib/workflows/dist/graph-definition.d.ts +5 -1
  230. package/lib/workflows/dist/graph-definition.d.ts.map +1 -1
  231. package/lib/workflows/dist/graph-definition.js +8 -4
  232. package/lib/workflows/dist/graph-definition.js.map +1 -1
  233. package/lib/workflows/dist/lifecycle-definition.d.ts +5 -1
  234. package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -1
  235. package/lib/workflows/dist/lifecycle-definition.js +5 -2
  236. package/lib/workflows/dist/lifecycle-definition.js.map +1 -1
  237. package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -1
  238. package/lib/workflows/dist/lifecycle-runtime.js +4 -5
  239. package/lib/workflows/dist/lifecycle-runtime.js.map +1 -1
  240. package/lib/workflows/dist/node-batches.d.ts +9 -0
  241. package/lib/workflows/dist/node-batches.d.ts.map +1 -0
  242. package/lib/workflows/dist/node-batches.js +19 -0
  243. package/lib/workflows/dist/node-batches.js.map +1 -0
  244. package/lib/workflows/dist/operator-transports.d.ts +1 -0
  245. package/lib/workflows/dist/operator-transports.d.ts.map +1 -1
  246. package/lib/workflows/dist/operator-transports.js +1 -0
  247. package/lib/workflows/dist/operator-transports.js.map +1 -1
  248. package/lib/workflows/dist/runtime.d.ts.map +1 -1
  249. package/lib/workflows/dist/runtime.js +6 -7
  250. package/lib/workflows/dist/runtime.js.map +1 -1
  251. package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -1
  252. package/lib/workflows/dist/scheduled-helpers.js +3 -2
  253. package/lib/workflows/dist/scheduled-helpers.js.map +1 -1
  254. package/lib/workflows/dist/scheduled.d.ts.map +1 -1
  255. package/lib/workflows/dist/scheduled.js +2 -1
  256. package/lib/workflows/dist/scheduled.js.map +1 -1
  257. package/lib/workflows/package.json +1 -1
  258. package/lib/workflows/src/children-definition.ts +10 -3
  259. package/lib/workflows/src/children-runtime.ts +3 -2
  260. package/lib/workflows/src/definition.ts +9 -2
  261. package/lib/workflows/src/graph-definition.ts +10 -3
  262. package/lib/workflows/src/lifecycle-definition.ts +10 -3
  263. package/lib/workflows/src/lifecycle-runtime.ts +4 -4
  264. package/lib/workflows/src/node-batches.ts +21 -0
  265. package/lib/workflows/src/operator-transports.ts +3 -1
  266. package/lib/workflows/src/runtime.ts +6 -6
  267. package/lib/workflows/src/scheduled-helpers.ts +3 -2
  268. package/lib/workflows/src/scheduled.ts +2 -1
  269. package/lib/workstream/package.json +1 -1
  270. package/llms-full.txt +1442 -281
  271. package/llms.txt +17 -3
  272. package/package.json +4 -4
  273. package/lib/cli/starters/cli-agent/dot-github/workflows/ci.yml +0 -13
  274. package/lib/cli/starters/cli-agent/dot-gitignore +0 -10
  275. package/lib/cli/starters/event-automation/dot-dockerignore +0 -7
  276. package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +0 -13
  277. package/lib/cli/starters/event-automation/src/model.ts +0 -40
  278. package/lib/cli/starters/event-automation/tsconfig.json +0 -20
  279. package/lib/cli/starters/nextjs/Dockerfile +0 -12
  280. package/lib/cli/starters/nextjs/compose.yaml +0 -19
  281. package/lib/cli/starters/nextjs/dot-dockerignore +0 -11
  282. package/lib/cli/starters/nextjs/dot-env.example +0 -7
  283. package/lib/cli/starters/nextjs/scripts/setup.mjs +0 -9
  284. package/lib/cli/starters/nextjs/server/application.mjs +0 -74
  285. package/lib/cli/starters/nextjs/server/auth.mjs +0 -24
  286. package/lib/cli/starters/nextjs/server/worker.mjs +0 -11
  287. package/lib/cli/starters/nextjs/server/workflows.mjs +0 -23
  288. package/lib/cli/starters/nextjs/src/ChatApp.jsx +0 -57
  289. package/lib/cli/starters/nextjs/src/Notebook.jsx +0 -25
  290. package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +0 -142
  291. package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +0 -142
  292. package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +0 -9
  293. package/lib/cli/starters/nextjs/src/components/mayura/ui.css +0 -14
  294. package/lib/cli/starters/nextjs/src/connect.js +0 -21
  295. package/lib/cli/starters/nextjs/src/session.js +0 -138
  296. package/lib/cli/starters/nextjs/src/style.css +0 -11
  297. package/lib/cli/starters/nextjs/test/server.test.mjs +0 -95
  298. package/lib/cli/starters/nextjs/test/session.test.mjs +0 -16
  299. package/lib/cli/starters/nuxt/compose.yaml +0 -19
  300. package/lib/cli/starters/nuxt/dot-dockerignore +0 -11
  301. package/lib/cli/starters/nuxt/dot-env.example +0 -7
  302. package/lib/cli/starters/nuxt/dot-gitignore +0 -14
  303. package/lib/cli/starters/nuxt/scripts/setup.mjs +0 -9
  304. package/lib/cli/starters/nuxt/server/application.mjs +0 -74
  305. package/lib/cli/starters/nuxt/server/auth.mjs +0 -24
  306. package/lib/cli/starters/nuxt/server/worker.mjs +0 -11
  307. package/lib/cli/starters/nuxt/server/workflows.mjs +0 -23
  308. package/lib/cli/starters/nuxt/src/connect.js +0 -21
  309. package/lib/cli/starters/nuxt/src/session.js +0 -138
  310. package/lib/cli/starters/nuxt/src/style.css +0 -11
  311. package/lib/cli/starters/nuxt/test/server.test.mjs +0 -95
  312. package/lib/cli/starters/nuxt/test/session.test.mjs +0 -16
  313. package/lib/cli/starters/react-router/Dockerfile +0 -12
  314. package/lib/cli/starters/react-router/compose.yaml +0 -19
  315. package/lib/cli/starters/react-router/dot-dockerignore +0 -11
  316. package/lib/cli/starters/react-router/dot-env.example +0 -7
  317. package/lib/cli/starters/react-router/dot-gitignore +0 -14
  318. package/lib/cli/starters/react-router/scripts/setup.mjs +0 -9
  319. package/lib/cli/starters/react-router/server/application.mjs +0 -74
  320. package/lib/cli/starters/react-router/server/auth.mjs +0 -24
  321. package/lib/cli/starters/react-router/server/worker.mjs +0 -11
  322. package/lib/cli/starters/react-router/server/workflows.mjs +0 -23
  323. package/lib/cli/starters/react-router/src/ChatApp.jsx +0 -57
  324. package/lib/cli/starters/react-router/src/Notebook.jsx +0 -25
  325. package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +0 -142
  326. package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +0 -142
  327. package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +0 -9
  328. package/lib/cli/starters/react-router/src/components/mayura/ui.css +0 -14
  329. package/lib/cli/starters/react-router/src/connect.js +0 -21
  330. package/lib/cli/starters/react-router/src/session.js +0 -138
  331. package/lib/cli/starters/react-router/src/style.css +0 -11
  332. package/lib/cli/starters/react-router/src/vite-env.d.ts +0 -1
  333. package/lib/cli/starters/react-router/test/server.test.mjs +0 -95
  334. package/lib/cli/starters/react-router/test/session.test.mjs +0 -16
  335. package/lib/cli/starters/research-team/dot-dockerignore +0 -7
  336. package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +0 -13
  337. package/lib/cli/starters/research-team/dot-gitignore +0 -10
  338. package/lib/cli/starters/research-team/src/model.ts +0 -40
  339. package/lib/cli/starters/research-team/tsconfig.json +0 -20
  340. package/lib/cli/starters/support-agent/dot-dockerignore +0 -7
  341. package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +0 -13
  342. package/lib/cli/starters/support-agent/dot-gitignore +0 -10
  343. package/lib/cli/starters/support-agent/src/model.ts +0 -40
  344. package/lib/cli/starters/support-agent/tsconfig.json +0 -20
  345. package/lib/cli/starters/sveltekit/Dockerfile +0 -12
  346. package/lib/cli/starters/sveltekit/compose.yaml +0 -19
  347. package/lib/cli/starters/sveltekit/dot-dockerignore +0 -11
  348. package/lib/cli/starters/sveltekit/dot-env.example +0 -7
  349. package/lib/cli/starters/sveltekit/dot-gitignore +0 -14
  350. package/lib/cli/starters/sveltekit/scripts/setup.mjs +0 -9
  351. package/lib/cli/starters/sveltekit/server/application.mjs +0 -74
  352. package/lib/cli/starters/sveltekit/server/auth.mjs +0 -24
  353. package/lib/cli/starters/sveltekit/server/worker.mjs +0 -11
  354. package/lib/cli/starters/sveltekit/server/workflows.mjs +0 -23
  355. package/lib/cli/starters/sveltekit/src/connect.js +0 -21
  356. package/lib/cli/starters/sveltekit/src/session.js +0 -138
  357. package/lib/cli/starters/sveltekit/src/style.css +0 -11
  358. package/lib/cli/starters/sveltekit/src/view.js +0 -49
  359. package/lib/cli/starters/sveltekit/test/server.test.mjs +0 -95
  360. package/lib/cli/starters/sveltekit/test/session.test.mjs +0 -16
  361. package/lib/cli/starters/tanstack-start/Dockerfile +0 -12
  362. package/lib/cli/starters/tanstack-start/compose.yaml +0 -19
  363. package/lib/cli/starters/tanstack-start/dot-dockerignore +0 -11
  364. package/lib/cli/starters/tanstack-start/dot-env.example +0 -7
  365. package/lib/cli/starters/tanstack-start/dot-gitignore +0 -14
  366. package/lib/cli/starters/tanstack-start/scripts/setup.mjs +0 -9
  367. package/lib/cli/starters/tanstack-start/server/application.mjs +0 -74
  368. package/lib/cli/starters/tanstack-start/server/auth.mjs +0 -24
  369. package/lib/cli/starters/tanstack-start/server/worker.mjs +0 -11
  370. package/lib/cli/starters/tanstack-start/server/workflows.mjs +0 -23
  371. package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +0 -57
  372. package/lib/cli/starters/tanstack-start/src/Notebook.jsx +0 -25
  373. package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +0 -142
  374. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +0 -142
  375. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +0 -9
  376. package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +0 -14
  377. package/lib/cli/starters/tanstack-start/src/connect.js +0 -21
  378. package/lib/cli/starters/tanstack-start/src/session.js +0 -138
  379. package/lib/cli/starters/tanstack-start/src/style.css +0 -11
  380. package/lib/cli/starters/tanstack-start/test/server.test.mjs +0 -95
  381. package/lib/cli/starters/tanstack-start/test/session.test.mjs +0 -16
  382. /package/lib/cli/{starters/hono/src/components/mayura/ui.css → starter-assets/011cacc77ada0de5b447674e9fc4374a247b9a46eb169722b12649753f24188f} +0 -0
  383. /package/lib/cli/{starters/hono/test/server.test.mjs → starter-assets/0c825d6a776673ec6274cfc29cd45b1a8c56dcb880c291a91075c77e1ef1e4f3} +0 -0
  384. /package/lib/cli/{starters/hono/server/auth.mjs → starter-assets/0dd570bfacc357d23be3340250090b9a4c6193a49cdd02e9b6789e7bee8433dd} +0 -0
  385. /package/lib/cli/{starters/hono/src/components/mayura/approval.tsx → starter-assets/11292bd14cdaf27a8f8317ba4ab768d706a726b2e26474b599f3db116674b4b3} +0 -0
  386. /package/lib/cli/{starters/nextjs/dot-gitignore → starter-assets/1873b02e070347f9a449e07084242982fa6af412c45aa764985d553975b64589} +0 -0
  387. /package/lib/cli/{starters/hono/src/style.css → starter-assets/2f3869e6d69134e43be713c4590bfe48896a5c54ece6ffc1a4f204cfcfe54218} +0 -0
  388. /package/lib/cli/{starters/hono/server/worker.mjs → starter-assets/350d77757f548369beff29d658cf1620752d4e23b4b732d99a1b403ca043137f} +0 -0
  389. /package/lib/cli/{starters/approval-workflow/src/model.ts → starter-assets/37294d24c04b71eaf6d6f0bd52fd4c1cc7a5d3cb63da9c7920ed1d44276da9cb} +0 -0
  390. /package/lib/cli/{starters/approval-workflow/tsconfig.json → starter-assets/4387d6537dd5924ae62326aa3d7d8cbad1e5abd930aecc9daa6fab1ac2f6ef24} +0 -0
  391. /package/lib/cli/{starters/hono/dot-dockerignore → starter-assets/4434be031b58cc6ee680b2860b2ad1fe4089af7ee866c13223dfb621dd042ff1} +0 -0
  392. /package/lib/cli/{starters/hono/src/ChatApp.jsx → starter-assets/46e199317648a076243d6c8e7ffedc48785a6ffc0f203b88c7c4a9479b34c5b9} +0 -0
  393. /package/lib/cli/{starters/hono/src/components/mayura/thread-history.tsx → starter-assets/4741fccbca2e0d2fc6f61d11af3cf7bcc5f0238b67bb46282287207abdc6c536} +0 -0
  394. /package/lib/cli/{starters/approval-workflow/dot-dockerignore → starter-assets/4be664708b0120da5d2b73c5a27968093da06b8728f88f2bda2a1ccbf40f6891} +0 -0
  395. /package/lib/cli/{starters/hono/server/workflows.mjs → starter-assets/4d11f729672df54969a851494877a3c5aee24bb8f8c68eacaaa22e715bf5ed69} +0 -0
  396. /package/lib/cli/{starters/hono/dot-env.example → starter-assets/4f141323062660c4dc5b563300d57bb4cdbdc7fe9bfba96e43d9c64bb274474e} +0 -0
  397. /package/lib/cli/{starters/hono/Dockerfile → starter-assets/5471b74c46258d1edb00eb8f60f4219c389a252f7e224f2692f8f3e71ae43e3e} +0 -0
  398. /package/lib/cli/{starters/hono/scripts/setup.mjs → starter-assets/56e2d6db9fe4b0449c979acd06947a5b776bcc645184b54b8d3654a48bd12c38} +0 -0
  399. /package/lib/cli/{starters/hono/src/Notebook.jsx → starter-assets/6138d1e2ca4469daf4f5545d140943f6e23b0c37f865051b266ec99695cf181a} +0 -0
  400. /package/lib/cli/{starters/hono/src/vite-env.d.ts → starter-assets/65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5} +0 -0
  401. /package/lib/cli/{starters/hono/server/application.mjs → starter-assets/757f43c27415654049ecf01b67d560c83d788108d1aebcf1f16a86d956bd7fb6} +0 -0
  402. /package/lib/cli/{starters/hono/src/components/mayura/thread-list.tsx → starter-assets/97601d0bf331df7bbde88f7ee269610bc8a1239f8eeb58fded6416e588a5b7dd} +0 -0
  403. /package/lib/cli/{starters/approval-workflow/dot-github/workflows/ci.yml → starter-assets/aa4182c76778ba2194ecbfde9a960c20181534fd1ab484df126278dbc6eb0186} +0 -0
  404. /package/lib/cli/{starters/hono/src/session.js → starter-assets/abcc6ebd29ba47a079befb6568054dec8f43d4c729187e4a3610af39789e77be} +0 -0
  405. /package/lib/cli/{starters/hono/compose.yaml → starter-assets/cc1df6f5ce0eebffc567ecea1d599eba97cd1b94ab01551085c0eb87a28e3a6c} +0 -0
  406. /package/lib/cli/{starters/hono/src/connect.js → starter-assets/cd3ddb959b277e7d495cc020a6f8146acfbcc9d05ececa3809e8aafcf84504d9} +0 -0
  407. /package/lib/cli/{starters/hono/test/session.test.mjs → starter-assets/dfe75fd07538427d80ba76767e037e929664c80ff5a41b7544496a789181bb73} +0 -0
  408. /package/lib/cli/{starters/approval-workflow/dot-gitignore → starter-assets/f3ef7285253ec9668732f535306beee602e91cb6e20f83d4799b3323399ce569} +0 -0
  409. /package/lib/cli/{starters/nuxt/src/view.js → starter-assets/ff840fe960683d377e78f731b5d4318adf6050384791fa20e4948d34192aa35d} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"scheduled-database.js","sourceRoot":"","sources":["../src/scheduled-database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoF,MAAM,cAAc,CAAC;AAC3H,OAAO,EACL,kCAAkC,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EACpG,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAIlE,qBAAqB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,yBAAyB,EAClH,uCAAuC,EAEvC,6BAA6B,EAAE,0BAA0B,GAE1D,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAyB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAyB,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC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CAAC,kBAAkB,CAAC,EAAE,EAAC,GAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,GAAG,CAAC,CAAC;wBAAC,OAAO,SAAS,CAAC;oBAAC,CAAC;oBACvG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,GAAG,CAAC,CAAC;oBAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;gBACH,IAAI,MAAM;oBAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,IAAI,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC;oBAAE,MAAM,KAAK,CAAC;YAAC,CAAC;QACxE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { jsonValue, type ExecutionReceipt, type ExecutionSettlement, type JsonObject, type JsonValue } from '@mayura/core';\nimport {\n assertWorkflowStateMatchesManifest, initialWorkflowState, mergeWorkflowReceipt, workflowHashMaterial,\n workflowManifest, workflowPolicy, workflowResources, workflowState,\n type Claim, type EvidenceDisposition, type JobRecord, type ScheduledWorkflowSnapshot, type SchedulerEvidence,\n type WorkflowFormat2State, type WorkflowFormat2Step, type WorkflowManifest, type WorkflowManifestNode,\n type WorkflowPolicyManifest, type WorkflowResourcePlan, type ExecutionRef, type ExecutionCompletion,\n workflowGraphManifest, workflowGraphState, workflowGraphResources, workflowGraphTargets, initialWorkflowGraphState,\n assertWorkflowGraphStateMatchesManifest, type WorkflowGraphManifest, type WorkflowGraphManifestNode,\n type WorkflowGraphFormat3State, type WorkflowGraphFormat3Step, type WorkflowGraphStoreSnapshot,\n workflowGraphDiscoveryCommand, workflowGraphDiscoveryPage,\n type WorkflowGraphDiscoveryStore, type WorkflowGraphDiscoveryScan, type WorkflowGraphDiscoveryCandidate,\n} from '@mayura/storage-contracts';\nimport { StorageError, type StoredEventInput } from './contracts.js';\nimport { aggregateRecord, storedInteger, type AggregateRow } from './aggregate-session.js';\nimport { ResourceBusy, SchedulerDatabase, type SchedulerBackend } from './scheduler-database.js';\nimport { fields, hash, integer, object } from './scheduler-validation.js';\nimport { scheduledCommand, type ScheduledMethod } from './scheduled-validation.js';\nimport { createCommand, identifier, nextCounter } from './validation.js';\nimport { checkCompletion, completionOf } from './execution-completions.js';\nimport { sha256Hex } from '@mayura/core/host';\nimport { sqlScheduledPersistence, type ScheduledPersistence, type ScheduledTransaction, type WorkflowOwnerRow, type WorkflowWaitTargetRow } from './scheduled-persistence.js';\n\ninterface Journal { id: string; digest: string; version: number; operation: string }\ninterface Owner {\n format: 1 | 2; manifest: Manifest; policy: WorkflowPolicyManifest; resources: WorkflowResourcePlan;\n clockFloor: number; commands: Journal[];\n /** Definition digests this run was migrated from, oldest first. Job history pinned to them stays valid. */\n lineage?: string[];\n}\ntype OwnerRow = WorkflowOwnerRow;\ntype WaitTargetRow = WorkflowWaitTargetRow;\ntype Session = ScheduledTransaction;\ntype Manifest = WorkflowManifest | WorkflowGraphManifest;\ntype Node = WorkflowManifestNode | WorkflowGraphManifestNode;\ntype State = WorkflowFormat2State | WorkflowGraphFormat3State;\ntype Step = WorkflowFormat2Step | WorkflowGraphFormat3Step;\ntype Snapshot = ScheduledWorkflowSnapshot | WorkflowGraphStoreSnapshot;\ntype WaitTargets = Readonly<Record<string, readonly ExecutionRef[]>>;\ninterface LockedRun {\n row: AggregateRow; owner: Owner; ownerRow: OwnerRow; state: State;\n jobs: JobRecord[]; clock: { value: number }; events: StoredEventInput[];\n waits: WaitTargets; facts: Readonly<Record<string, readonly ExecutionCompletion[] | undefined>>;\n /** Transaction-local observations only; even absent facts are re-read by the next command. */\n targetFacts: Map<string, ExecutionCompletion | undefined>;\n}\ntype ToolNode = Extract<WorkflowManifestNode, { kind: 'tool' }>;\nconst terminalSteps = new Set(['succeeded','failed','blocked','unknown','skipped']);\nconst terminalRuns = new Set(['succeeded','failed','blocked','outcome_unknown','cancelled']);\nconst STALE = Symbol('scheduled-stale');\nconst REVIEW_EXPIRED = Symbol('scheduled-review-expired');\nfunction failed(): never { throw new StorageError('STORAGE_UNAVAILABLE', 'Stored scheduled workflow failed integrity validation.'); }\nfunction conflict(): never { throw new StorageError('CONFLICT', 'Scheduled workflow state or command content changed.'); }\nfunction limited(): never { throw new StorageError('LIMIT_EXCEEDED', 'Scheduled workflow history or output limit was reached.'); }\nfunction digest(domain: string, value: unknown): string { return sha256Hex(workflowHashMaterial(domain, value)); }\nfunction same(a: unknown, b: unknown): boolean { return workflowHashMaterial('compare', a) === workflowHashMaterial('compare', b); }\nfunction graphManifest(manifest: Manifest): manifest is WorkflowGraphManifest { return 'format' in manifest && manifest.format === 3; }\n/** The store's time, never earlier than `floor`. */\nasync function storageClock(tx: Session, floor = 0): Promise<number> { return Math.max(floor, storedInteger(await tx.clock())); }\ninterface AccountingProjection { readonly receipt: ExecutionReceipt; readonly settlement: ExecutionSettlement }\n\nfunction executionSettlement(value: ExecutionSettlement | undefined, receipt: ExecutionReceipt, maximum: number): ExecutionSettlement {\n const fallback = receipt.execution === 'unknown' ? {knownCostMicros:0,unknownCostMicros:maximum}\n : receipt.execution === 'not_started' ? {knownCostMicros:0,unknownCostMicros:0}\n : {knownCostMicros:maximum,unknownCostMicros:0};\n const result = value ?? fallback;\n if (!Number.isSafeInteger(result.knownCostMicros) || result.knownCostMicros < 0\n || !Number.isSafeInteger(result.unknownCostMicros) || result.unknownCostMicros < 0\n || result.knownCostMicros > maximum - result.unknownCostMicros\n || (receipt.execution !== 'unknown' && result.unknownCostMicros !== 0)\n || (receipt.execution === 'not_started' && result.knownCostMicros !== 0)) failed();\n return Object.freeze({knownCostMicros:result.knownCostMicros,unknownCostMicros:result.unknownCostMicros});\n}\n\n/** Finite integrated reducer. Every mutation uses its caller-owned connection/transaction. */\nexport class ScheduledWorkflowDatabase {\n private initialized = false;\n private discoveryInitialized = false;\n private readonly persistence: ScheduledPersistence;\n constructor(backend: SchedulerBackend | ScheduledPersistence, private readonly scheduler: SchedulerDatabase) {\n this.persistence = 'dialect' in backend ? sqlScheduledPersistence(backend) : backend;\n }\n private hashEnrollment(manifest: Manifest, policy: WorkflowPolicyManifest, resources: WorkflowResourcePlan) {\n return { scope: digest('mayura:scope:v1',policy.scope), definition: digest(graphManifest(manifest) ? 'mayura:workflow:v2' : 'mayura:workflow:v1',manifest),\n policy: digest('mayura:policy:v1',policy), resources: digest('mayura:workflow-resources:v1',resources) };\n }\n private decode(row: OwnerRow, aggregate: AggregateRow): Owner {\n try {\n if (![1,2].includes(Number(row.profile)) || row.scope !== aggregate.scope || row.aggregate_id !== aggregate.id || storedInteger(row.aggregate_version) !== storedInteger(aggregate.version)) failed();\n const raw = object(JSON.parse(row.data));\n fields(raw,Object.hasOwn(raw,'lineage') ? ['format','manifest','policy','resources','clockFloor','commands','lineage'] : ['format','manifest','policy','resources','clockFloor','commands']);\n const lineage = raw['lineage'] === undefined ? undefined : raw['lineage'];\n if (lineage !== undefined && (!Array.isArray(lineage) || lineage.length < 1 || lineage.length > 64 || lineage.some(item => typeof item !== 'string' || !/^[a-f0-9]{64}$/.test(item)))) failed();\n if (raw['format'] !== Number(row.profile)) failed(); integer(raw['clockFloor']);\n const manifest = raw['format'] === 2 ? workflowGraphManifest(raw['manifest']) : workflowManifest(raw['manifest']);\n const policy = workflowPolicy(raw['policy']);\n const resources = graphManifest(manifest) ? workflowGraphResources(raw['resources'],manifest) : workflowResources(raw['resources'],manifest);\n if (!same(manifest,raw['manifest']) || !same(policy,raw['policy']) || !same(resources,raw['resources'])) failed();\n const hashes = this.hashEnrollment(manifest,policy,resources);\n if (hashes.scope !== aggregate.scope || hashes.definition !== aggregate.definition_hash || hashes.definition !== row.definition_hash || hashes.policy !== row.policy_hash || hashes.resources !== row.resource_hash) failed();\n if (!Array.isArray(raw['commands']) || raw['commands'].length > 1024) failed();\n const ids = new Set<string>(); let lastVersion = 0;\n for (const entry of raw['commands']) {\n const command = object(entry); fields(command,['id','digest','version','operation']);\n const id = identifier(command['id'],'Stored command'); if (ids.has(id)) failed(); ids.add(id);\n hash(command['digest']); identifier(command['operation'],'Stored operation'); integer(command['version'],1,storedInteger(aggregate.version));\n if ((command['version'] as number) <= lastVersion) failed(); lastVersion = command['version'] as number;\n }\n return { format: raw['format'] as 1 | 2, manifest, policy, resources, clockFloor: raw['clockFloor'] as number, commands: raw['commands'] as unknown as Journal[],\n ...(lineage === undefined ? {} : { lineage: lineage as string[] }) };\n } catch { return failed(); }\n }\n private checkedState(row: AggregateRow, owner: Owner): State {\n try {\n let state: State;\n if (graphManifest(owner.manifest)) { state = workflowGraphState(aggregateRecord(row)); assertWorkflowGraphStateMatchesManifest(state,owner.manifest); }\n else { state = workflowState(aggregateRecord(row)); assertWorkflowStateMatchesManifest(state,owner.manifest); }\n const hashes = this.hashEnrollment(owner.manifest,owner.policy,owner.resources);\n if (state.definition !== hashes.definition || state.policy !== hashes.policy || state.maxCostMicros !== owner.policy.maxCostMicros) failed();\n jsonValue(state.input,{maxBytes:owner.policy.maxOutputBytes}); jsonValue(state.output,{maxBytes:owner.policy.maxOutputBytes});\n for (const step of Object.values(state.steps)) jsonValue(step.output,{maxBytes:owner.policy.maxOutputBytes});\n return state;\n } catch { return failed(); }\n }\n private async load(tx: Session, scope: string, id: string, policyHash: string, skip = false, profile?: 1 | 2): Promise<LockedRun | undefined> {\n const row = await tx.aggregate(scope,id,skip);\n if (!row) { if (skip) return undefined; throw new StorageError('NOT_FOUND','Workflow was not found in this scope.'); }\n const ownerRow = await tx.owner(scope,id);\n if (!ownerRow) throw new StorageError('SCHEDULED_WRITER_REQUIRED','The run is not enrolled in scheduled execution.');\n if (profile !== undefined && Number(ownerRow.profile) !== profile) conflict();\n const owner = this.decode(ownerRow,row); if (ownerRow.policy_hash !== policyHash) conflict();\n const state = this.checkedState(row,owner);\n // Lock every bounded owned job before touching any resource. Controls can safely visit them in any order afterwards.\n const jobIds = await tx.lockRunJobs(scope,id);\n const links = await tx.links(scope,id);\n if (links.length > 128 || links.length !== jobIds.length || links.some((link,index) => link.job_id !== jobIds[index])) failed();\n const events: StoredEventInput[] = []; const clock = { value: owner.clockFloor }; const jobs: JobRecord[] = [];\n const local = this.scheduler.inSession(tx,id,events,undefined,clock);\n for (const link of links) {\n const job = await local.execute('read',{scope,jobId:link.job_id}) as JobRecord | undefined;\n const node = owner.manifest.graph.find(node => node.id === link.node_id); const step = state.steps[link.node_id];\n if (!job || !node || node.kind !== 'tool' || !step || job.nodeId !== node.id || job.runId !== id\n || (job.definitionHash !== row.definition_hash && !owner.lineage?.includes(job.definitionHash)) || job.candidateHash !== step.candidateHash\n || job.intent['toolId'] !== node.tool || job.intent['callId'] !== `${id}/${step.callId}`\n || job.intent['policyHash'] !== policyHash || !same(job.resourceKeys,owner.resources[node.id])) failed();\n if (job.state === 'succeeded' && (step.status !== 'succeeded' || !same(step.output,job.output) || !same(step.receipt,job.receipt))) failed();\n if (['ready','leased'].includes(job.state) && !['pending','approved'].includes(step.status)) failed();\n if (job.state === 'started' && step.status !== 'dispatching') failed();\n jobs.push(job);\n }\n for (const [nodeId,step] of Object.entries(state.steps)) if (step.candidateHash !== null && !links.some(link => link.node_id === nodeId)) failed();\n clock.value = await storageClock(tx,clock.value);\n const waits = graphManifest(owner.manifest) ? workflowGraphTargets(owner.manifest,state.input) : {};\n const run: LockedRun = { row,owner,ownerRow,state,jobs,clock,events,waits,facts:{},targetFacts:new Map() };\n await this.checkWaitProjection(tx,run);\n await this.checkProjection(tx,run);\n await checkCompletion(tx,row,policyHash,state.status,false); return run;\n }\n /** Parent-owned immutable edges are recomputed from the admitted input, never trusted as a second authority.\n * Only immutable target facts/identity columns are read here; no target workflow lock is acquired.\n */\n private async checkWaitProjection(tx: Session, run: LockedRun): Promise<void> {\n try {\n const rows: WaitTargetRow[] = await tx.waitTargets(run.row.scope,run.row.id);\n const expected = Object.entries(run.waits); const count = expected.reduce((total,[,targets]) => total + targets.length,0);\n if (rows.length !== count || count > 128) failed();\n const seen = new Set<string>();\n for (const row of rows) {\n const ordinal = storedInteger(row.ordinal); const reference = run.waits[row.node_id]?.[ordinal];\n const key = JSON.stringify([row.node_id,ordinal]); if (seen.has(key)) failed(); seen.add(key);\n if (!reference || row.scope !== run.row.scope || row.aggregate_id !== run.row.id || row.run_id !== reference.runId\n || row.definition_hash !== reference.definitionHash || row.policy_hash !== reference.policyHash\n || row.policy_hash !== run.ownerRow.policy_hash || row.run_id === run.row.id) failed();\n }\n const facts: Record<string, readonly ExecutionCompletion[] | undefined> = {};\n for (const [nodeId,targets] of expected) {\n const observations: ExecutionCompletion[] = []; let complete = true;\n for (const reference of targets) {\n const key = JSON.stringify([reference.kind,reference.runId,reference.definitionHash,reference.policyHash]);\n if (!run.targetFacts.has(key)) {\n await this.checkTargetIdentity(tx,run.row.scope,run.row.id,run.ownerRow.policy_hash,reference);\n run.targetFacts.set(key,await completionOf(tx,run.row.scope,reference));\n }\n // Repeated edges retain independent row/order checks above. Only immutable identities\n // and facts share this command-local observation; no target business lock is acquired.\n const fact = run.targetFacts.get(key);\n if (fact) observations.push(fact); else complete = false;\n }\n facts[nodeId] = complete ? observations : undefined;\n const step = run.state.steps[nodeId];\n // A wait can fail only after a complete observation fails output admission.\n // It cannot fabricate terminal failure while any target is still pending.\n if (step?.status === 'failed' && !complete) failed();\n if (!step || step.kind !== 'wait' || run.jobs.some(job => job.nodeId === nodeId)\n || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0) failed();\n if (step.status === 'succeeded' && (!complete || !same(step.output,observations))) failed();\n }\n run.facts = facts;\n } catch { failed(); }\n }\n /** Verify already-existing immutable owner identities without taking target business locks. */\n private async checkTargetIdentity(tx: Session, scope: string, parentId: string, policyHash: string, reference: ExecutionRef): Promise<void> {\n if (reference.runId === parentId || reference.policyHash !== policyHash) conflict();\n const row = await tx.ownerIdentity(scope,reference.runId);\n if (!row || row.scope !== scope || row.aggregate_id !== reference.runId || ![1,2].includes(Number(row.profile))\n || row.definition_hash !== reference.definitionHash || row.policy_hash !== policyHash) conflict();\n }\n /** Independently derive effect facts and accounting from the attempt ledger, never from aggregate claims. */\n private async checkProjection(tx: Session,run: LockedRun): Promise<void> {\n try {\n let spent = 0;\n for (const node of run.owner.manifest.graph) {\n const step = run.state.steps[node.id]!; const job = run.jobs.find(item => item.nodeId === node.id);\n if (!job) {\n if (step.candidateHash !== null || step.receipt !== null || step.costReserved !== 0 || step.status === 'dispatching' || step.status === 'unknown') failed();\n if (node.kind === 'tool' && step.status === 'succeeded') failed();\n if (node.kind === 'join' && step.status === 'succeeded' && !same(step.output,node.dependsOn.map(id => run.state.steps[id]!.output))) failed();\n continue;\n }\n if (node.kind !== 'tool' || step.candidateHash === null) failed();\n const allowed: Record<JobRecord['state'], readonly string[]> = {\n ready: [node.approval ? 'approved' : 'pending'], leased: [node.approval ? 'approved' : 'pending'],\n started: ['dispatching'], succeeded: ['succeeded'], failed: ['failed'], blocked: ['blocked'],\n cancelled: ['skipped','failed','blocked'], outcome_unknown: ['unknown'],\n };\n if (!allowed[job.state].includes(step.status) || (node.approval && !step.approval?.humanId)) failed();\n const accounting = await this.accounting(tx,run,job,node); let projected = accounting?.receipt ?? null;\n if (projected && job.state === 'succeeded') projected = { ...projected,disclosure:'released' };\n if (!same(projected,step.receipt)) failed();\n const expectedReservation = accounting ? accounting.settlement.unknownCostMicros\n : job.startedAtMs === null && ['cancelled','blocked'].includes(job.state) ? 0 : node.costMicros;\n if (step.costReserved !== expectedReservation) failed();\n if (accounting) spent = nextCounter(spent,accounting.settlement.knownCostMicros);\n }\n if (spent !== run.state.spentMicros || (['succeeded','failed','blocked','outcome_unknown'].includes(run.state.status)\n && Object.values(run.state.steps).some(step => !terminalSteps.has(step.status)))) failed();\n } catch { failed(); }\n }\n private snapshot(run: LockedRun): Snapshot {\n return { record: aggregateRecord(run.row), profile:run.owner.format === 1 ? 'scheduled-v1' : 'scheduled-v2', manifestHash:run.ownerRow.definition_hash,\n policyHash:run.ownerRow.policy_hash, resourceHash:run.ownerRow.resource_hash, jobs:run.jobs };\n }\n /** Reconstruct cost facts from immutable attempt evidence; legacy evidence remains conservatively fixed-cost. */\n private async accounting(tx: Session,run: LockedRun,job: JobRecord,node: ToolNode): Promise<AccountingProjection | undefined> {\n if (job.fence === 0) return undefined;\n const evidence = await this.local(tx,run).execute('receipts',{scope:run.row.scope,jobId:job.jobId,fence:job.fence}) as SchedulerEvidence[];\n let projected: AccountingProjection | undefined;\n for (const item of evidence) if (item.disposition !== 'conflicting') {\n const current = executionSettlement(item.settlement,item.receipt,node.costMicros);\n if (!projected) projected = {receipt:mergeWorkflowReceipt(null,item.receipt),settlement:current};\n else {\n const merged = mergeWorkflowReceipt(projected.receipt,item.receipt);\n if (projected.receipt.execution === 'unknown' && item.receipt.execution !== 'unknown') projected = {receipt:merged,settlement:current};\n else if (projected.receipt.execution === 'unknown' && item.receipt.execution === 'unknown' && !same(projected.settlement,current)) {\n const refines = (next: ExecutionSettlement,before: ExecutionSettlement): boolean => next.knownCostMicros >= before.knownCostMicros\n && next.unknownCostMicros <= before.unknownCostMicros\n && next.knownCostMicros + next.unknownCostMicros <= before.knownCostMicros + before.unknownCostMicros;\n if (refines(current,projected.settlement)) projected = {receipt:merged,settlement:current};\n else if (!refines(projected.settlement,current)) failed();\n }\n else {\n if (!same(projected.settlement,current) && !(projected.receipt.execution !== 'unknown' && item.receipt.execution === 'unknown')) failed();\n projected = {receipt:merged,settlement:projected.settlement};\n }\n }\n }\n return projected && Object.freeze({receipt:projected.receipt,settlement:projected.settlement});\n }\n private local(tx: Session, run: LockedRun, jobId?: string, admissionExpiresAt?: number): SchedulerDatabase {\n return this.scheduler.inSession(tx,run.row.id,run.events,jobId,run.clock,admissionExpiresAt);\n }\n private replaceJob(run: LockedRun, job: JobRecord): void {\n const index = run.jobs.findIndex(item => item.jobId === job.jobId); if (index < 0) run.jobs.push(job); else run.jobs[index] = job;\n run.jobs.sort((a,b) => a.jobId < b.jobId ? -1 : a.jobId > b.jobId ? 1 : 0);\n }\n private semantic(method: ScheduledMethod, input: JsonObject): string {\n const value = { ...input }; delete value['expectedVersion'];\n if (value['claim']) { const token = { ...value['claim'] as JsonObject }; delete token['leaseUntilMs']; value['claim'] = token; }\n return digest('mayura:scheduled-command:v1',{ operation:method,...value });\n }\n private retry(run: LockedRun, method: ScheduledMethod, input: JsonObject): boolean {\n if (input['commandId'] === undefined) return false;\n const previous = run.owner.commands.find(item => item.id === input['commandId']);\n if (!previous) return false; if (previous.digest !== this.semantic(method,input) || previous.operation !== method) conflict(); return true;\n }\n private journal(run: LockedRun, method: ScheduledMethod, input: JsonObject): void {\n if (input['commandId'] === undefined) return;\n if (run.owner.commands.length >= 1024) limited();\n run.owner.commands.push({ id:input['commandId'] as string,digest:this.semantic(method,input),version:nextCounter(storedInteger(run.row.version),1),operation:method });\n }\n private async save(tx: Session, run: LockedRun, method?: ScheduledMethod, input?: JsonObject, event?: StoredEventInput): Promise<void> {\n if (method && input) this.journal(run,method,input);\n if (event) run.events.push(event);\n if (run.events.length === 0) run.events.push({type:'workflow.control',data:{operation:method ?? 'projection'}});\n run.owner.clockFloor = run.clock.value;\n const next = jsonValue(run.state) as JsonObject;\n this.checkedState({ ...run.row,state:JSON.stringify(next) },run.owner);\n await this.checkWaitProjection(tx,run);\n await this.checkProjection(tx,run);\n run.row = await tx.writeAggregate(run.row,next,run.events,run.clock.value);\n run.ownerRow.aggregate_version = run.row.version; run.ownerRow.data = JSON.stringify(object(run.owner));\n await tx.updateOwner(run.row.scope,run.row.id,run.row.version,run.ownerRow.data);\n await checkCompletion(tx,run.row,run.ownerRow.policy_hash,run.state.status,true);\n run.events.length = 0;\n }\n /**\n * Apply a reviewed migration to a locked, paused run. Everything is re-verified here: the caller's plan is advisory.\n * Steps with scheduler history and non-pending waits must be unchanged; other steps may only be carried unchanged\n * or re-enter as fresh pending steps. No other run may depend on this run's identity.\n */\n private async migrateRun(tx: Session, run: LockedRun, input: JsonObject): Promise<void> {\n const refuse = (message: string): never => { throw new StorageError('CONFLICT', `Migration refused: ${message}`); };\n if (run.state.status !== 'paused') refuse('the run must be paused.');\n if (run.jobs.some(job => job.state === 'leased' || job.state === 'started')) refuse('a job is leased or started.');\n if (await tx.workflowWaitsOn(run.row.scope,run.row.id)) refuse('another workflow waits on this run.');\n if (await tx.executionWaitTargets(run.row.scope,run.row.id)) refuse('an execution wait targets this run.');\n const manifest = input['manifest'] as unknown as Manifest; const resources = input['resources'] as unknown as WorkflowResourcePlan;\n if (graphManifest(manifest) !== graphManifest(run.owner.manifest)) refuse('the workflow format cannot change.');\n const hashes = this.hashEnrollment(manifest,run.owner.policy,resources);\n if (hashes.definition === run.ownerRow.definition_hash) refuse('the definition is unchanged.');\n const previous = run.state; const next = input['state'] as unknown as State;\n const checked = graphManifest(manifest) ? workflowGraphState({ id: run.row.id, state: next as unknown as JsonObject }) : workflowState({ id: run.row.id, state: next as unknown as JsonObject });\n if (checked.definition !== hashes.definition || checked.policy !== previous.policy || checked.maxCostMicros !== previous.maxCostMicros || checked.status !== 'paused'\n || !same(checked.input,previous.input) || checked.spentMicros !== previous.spentMicros || checked.output !== null) refuse('only steps and the definition may change.');\n const oldNodes = new Map(run.owner.manifest.graph.map(node => [node.id,node])); const newNodes = new Map(manifest.graph.map(node => [node.id,node]));\n for (const [id,step] of Object.entries(checked.steps)) {\n const before = previous.steps[id]; const jobbed = run.jobs.some(job => job.nodeId === id);\n if (before && same(step,before)) {\n // Carried unchanged: a step with history must also keep its exact node definition and resources.\n if ((jobbed || !['pending','skipped'].includes(before.status)) && (!same(oldNodes.get(id),newNodes.get(id)) || !same(run.owner.resources[id] ?? null,resources[id] ?? null))) {\n if (jobbed || before.status === 'waiting' && before.kind === 'wait') refuse(`step \"${id}\" has execution history and its definition changed.`);\n }\n continue;\n }\n if (jobbed) refuse(`step \"${id}\" has scheduler history and cannot change.`);\n if (before && !['pending','waiting','approved'].includes(before.status)) refuse(`settled step \"${id}\" can only be carried unchanged.`);\n if (step.status !== 'pending' || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0) refuse(`step \"${id}\" must re-enter as a fresh pending step.`);\n }\n for (const [id,before] of Object.entries(previous.steps)) {\n if (Object.hasOwn(checked.steps,id)) continue;\n if (run.jobs.some(job => job.nodeId === id && !['cancelled'].includes(job.state)) || before.status === 'dispatching' || before.status === 'unknown') refuse(`step \"${id}\" has execution history and cannot be removed.`);\n }\n // Waits: started wait nodes keep identical targets; the target rows are re-projected from the new manifest.\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,checked.input) : {};\n for (const [nodeId,targets] of Object.entries(run.waits)) {\n const step = previous.steps[nodeId];\n if (step && step.status !== 'pending' && !same(waits[nodeId] ?? null,targets)) refuse(`wait \"${nodeId}\" already started and its targets changed.`);\n }\n await tx.deleteWaitTargets(run.row.scope,run.row.id);\n for (const [nodeId,targets] of Object.entries(waits)) for (const [ordinal,target] of targets.entries()) {\n await this.checkTargetIdentity(tx,run.row.scope,run.row.id,run.ownerRow.policy_hash,target);\n await tx.insertWaitTarget({scope:run.row.scope,aggregate_id:run.row.id,node_id:nodeId,ordinal,run_id:target.runId,definition_hash:target.definitionHash,policy_hash:target.policyHash});\n }\n const lineage = [...(run.owner.lineage ?? []), run.ownerRow.definition_hash];\n if (lineage.length > 64) limited();\n run.owner = { ...run.owner, manifest, resources, lineage };\n run.state = checked; run.waits = waits; run.targetFacts = new Map();\n await tx.redefine(run.row.scope,run.row.id,hashes.definition,hashes.resources);\n run.row = { ...run.row, definition_hash: hashes.definition }; run.ownerRow = { ...run.ownerRow, definition_hash: hashes.definition, resource_hash: hashes.resources };\n }\n private node(run: LockedRun,id: string): ToolNode {\n const node = run.owner.manifest.graph.find(node => node.id === id); if (!node || node.kind !== 'tool') conflict(); return node;\n }\n /** A paused run schedules nothing; only recording an already-requested approval is admitted. */\n private ready(run: LockedRun,node: Node,allowPaused = false): void {\n if (terminalRuns.has(run.state.status) || (run.state.status === 'paused' && !allowPaused)\n || node.dependsOn.some(id => run.state.steps[id]?.status !== 'succeeded')) conflict();\n }\n private unprepared(run: LockedRun,node: ToolNode,allowPaused = false): Step {\n this.ready(run,node,allowPaused); const step = run.state.steps[node.id]!;\n if (run.jobs.some(job => job.nodeId === node.id) || !['pending','waiting','approved'].includes(step.status) || step.receipt || step.costReserved || step.candidateHash) conflict();\n return step;\n }\n private authorized(run: LockedRun,node: ToolNode): boolean {\n return [`tool:${node.tool}`,...node.capabilities,...(node.effects === 'none' ? [] : [`effect:${node.effects}`])].every(grant => run.owner.policy.permissions.includes(grant));\n }\n private candidate(run: LockedRun,node: ToolNode,input: JsonValue,expiresAt: number | null): string {\n try { jsonValue(input,{maxBytes:run.owner.policy.maxOutputBytes}); }\n catch { throw new StorageError('INVALID_INPUT','Candidate input exceeds the pinned workflow limit.'); }\n return digest('mayura:approval:v1',{runId:run.row.id,nodeId:node.id,tool:node.tool,toolVersion:node.toolVersion,input,policy:run.ownerRow.policy_hash,expiresAt});\n }\n private refund(run: LockedRun,step: Step,executed = false): void {\n run.state.reservedMicros -= step.costReserved;\n if (executed) run.state.spentMicros = nextCounter(run.state.spentMicros,step.costReserved);\n step.costReserved = 0;\n }\n private async refreshJob(tx: Session,run: LockedRun,jobId: string): Promise<JobRecord> {\n const job = await this.local(tx,run).execute('read',{scope:run.row.scope,jobId}) as JobRecord | undefined;\n if (!job) failed(); this.replaceJob(run,job); return job;\n }\n private job(run: LockedRun,input: JsonObject): JobRecord {\n const token = input['claim'] as unknown as Claim | undefined; const id = token?.jobId ?? input['jobId'];\n if (token && token.scope !== run.row.scope) conflict();\n const job = run.jobs.find(job => job.jobId === id); if (!job) conflict(); return job;\n }\n private mirrorJob(run: LockedRun,job: JobRecord): void {\n const step = run.state.steps[job.nodeId]!;\n if (job.state === 'outcome_unknown') { step.status = 'unknown'; step.output = null; }\n else if (job.state === 'cancelled' && job.startedAtMs === null) { if (!terminalSteps.has(step.status)) step.status = 'skipped'; this.refund(run,step); }\n else if (job.state === 'blocked' && job.startedAtMs === null) { step.status = 'blocked'; this.refund(run,step); }\n }\n private async cancelJob(tx: Session,run: LockedRun,job: JobRecord,commandId: string): Promise<JobRecord> {\n const result = await this.local(tx,run).execute('cancel',{scope:run.row.scope,jobId:job.jobId,commandId}) as JobRecord;\n this.replaceJob(run,result); this.mirrorJob(run,result); return result;\n }\n private expiredReview(run: LockedRun,job: JobRecord): boolean {\n const node = this.node(run,job.nodeId); const review = run.state.steps[node.id]!.approval;\n return node.approval && (!review || review.expiresAt <= run.clock.value);\n }\n /** Leave room for every future receipt, review identity and control counter before releasing output.\n * A full aggregate must never prevent cancellation or settlement of an already-started effect.\n * Control characters deliberately bound JSON escaping for a maximum-size verified human identity.\n */\n private admitsOutput(run: LockedRun,value: JsonValue,nodeId?: string): boolean {\n try {\n const output = jsonValue(value,{maxBytes:run.owner.policy.maxOutputBytes});\n const steps: Record<string,Step> = {};\n for (const node of run.owner.manifest.graph) {\n const step = { ...run.state.steps[node.id]!,output:node.id === nodeId ? output : run.state.steps[node.id]!.output };\n if (node.kind === 'tool') {\n step.status = 'dispatching'; step.candidateHash = 'f'.repeat(64); step.costReserved = Number.MAX_SAFE_INTEGER;\n step.receipt = {callId:`${run.row.id}/${step.callId}`,toolId:node.tool,execution:'not_started',disclosure:'withheld'};\n step.approval = node.approval ? {digest:'f'.repeat(64),expiresAt:Number.MAX_SAFE_INTEGER,humanId:'\\u0001'.repeat(256)} : null;\n } else {\n step.status = 'succeeded';\n // Every unresolved wait must retain room to settle after earlier tool outputs are admitted.\n // Use the longest terminal spelling and safe-counter widths; references are immutable.\n if (node.kind === 'wait' && node.id !== nodeId && step.output === null) step.output = jsonValue(run.waits[node.id]!.map(reference => ({\n reference, outcome:'outcome_unknown', sourceVersion:Number.MAX_SAFE_INTEGER, sourceEventSequence:Number.MAX_SAFE_INTEGER,\n })));\n }\n steps[node.id] = step;\n }\n // This is a size/depth/node-count projection only, not a persistable execution state.\n jsonValue({...run.state,status:'outcome_unknown',steps,spentMicros:Number.MAX_SAFE_INTEGER,reservedMicros:Number.MAX_SAFE_INTEGER,\n output:nodeId === undefined ? output : run.state.output});\n return true;\n } catch { return false; }\n }\n private async blockExpiredReview(tx: Session,run: LockedRun,job: JobRecord): Promise<boolean> {\n if (job.startedAtMs !== null || !['ready','leased'].includes(job.state) || !this.expiredReview(run,job)) return false;\n await this.cancelJob(tx,run,job,`review-expired:${job.jobId}`); run.state.steps[job.nodeId]!.status = 'blocked';\n run.events.push({type:'approval.expired',data:{nodeId:job.nodeId}}); return true;\n }\n private async observeReviewExpiry(tx: Session,run: LockedRun,nodeId: string): Promise<void> {\n const job = run.jobs.find(item => item.nodeId === nodeId);\n if (job) await this.blockExpiredReview(tx,run,job);\n if (run.events.length === 0 && run.clock.value > run.owner.clockFloor) run.events.push({type:'approval.expiry_observed',data:{nodeId}});\n // A rejected approval is not journaled as a successful command. Its monotonic observation is\n // nevertheless durable, so wall-clock rollback cannot make the same expired digest live again.\n if (run.events.length > 0) await this.save(tx,run);\n }\n private advance(run: LockedRun): void {\n if (terminalRuns.has(run.state.status) || run.state.status === 'paused') return;\n for (let pass = 0; pass < run.owner.manifest.graph.length; pass++) {\n let changed = false;\n for (const node of run.owner.manifest.graph) {\n const step = run.state.steps[node.id]!;\n if (!['pending','waiting','approved'].includes(step.status) || run.jobs.some(job => job.nodeId === node.id)) continue;\n const dependencies = node.dependsOn.map(id => run.state.steps[id]!);\n if (dependencies.some(step => terminalSteps.has(step.status) && step.status !== 'succeeded')) {\n step.status = 'skipped'; changed = true; run.events.push({type:'step.skipped',data:{nodeId:node.id}});\n } else if (node.kind === 'join' && dependencies.every(step => step.status === 'succeeded')) {\n const output = dependencies.map(step => step.output);\n if (this.admitsOutput(run,output,node.id)) { step.output = output; step.status = 'succeeded'; run.events.push({type:'step.completed',data:{nodeId:node.id}}); }\n else { step.output = null; step.status = 'failed'; run.events.push({type:'step.failed',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}}); }\n changed = true;\n } else if (node.kind === 'wait' && dependencies.every(step => step.status === 'succeeded')) {\n const facts = run.facts[node.id];\n if (facts) {\n const output = jsonValue(facts);\n if (this.admitsOutput(run,output,node.id)) {\n step.output = output; step.status = 'succeeded'; run.events.push({type:'workflow.wait_resolved',data:{nodeId:node.id}});\n } else { step.output = null; step.status = 'failed'; run.events.push({type:'step.failed',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}}); }\n changed = true;\n } else if (step.status === 'pending') {\n step.status = 'waiting'; changed = true; run.events.push({type:'workflow.waiting',data:{nodeId:node.id}});\n }\n }\n }\n if (!changed) break;\n }\n const steps = Object.values(run.state.steps);\n if (steps.every(step => terminalSteps.has(step.status)) && !steps.every(step => step.status === 'succeeded')) {\n run.state.status = steps.some(step => step.status === 'unknown') ? 'outcome_unknown' : steps.some(step => step.status === 'blocked') ? 'blocked' : 'failed';\n } else run.state.status = steps.some(step => step.status === 'waiting') && !steps.some(step => step.status === 'dispatching') ? 'waiting' : 'running';\n }\n private async initialize(): Promise<void> {\n if (this.initialized) return; await this.scheduler.execute('initialize',{});\n await this.persistence.initialize(); this.initialized = true;\n }\n /** Discovery provisions its index only when explicitly requested, never as an unindexed fallback. */\n private async initializeDiscovery(): Promise<void> {\n if (this.discoveryInitialized) return;\n await this.initialize();\n await this.persistence.initializeDiscovery();\n this.discoveryInitialized = true;\n }\n /**\n * Finite recovery hints, not a ready queue or execution grant. Selection releases its transaction\n * before each ordinary parent validation; no two parent locks or mutable target locks overlap.\n */\n async discover(method: keyof WorkflowGraphDiscoveryStore, value: unknown): Promise<unknown> {\n const input = workflowGraphDiscoveryCommand(method,value);\n if (method === 'initialize') return this.initializeDiscovery();\n if (!this.discoveryInitialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize workflow graph discovery before use.');\n const command = input as unknown as WorkflowGraphDiscoveryScan;\n try {\n const afterId = command.cursor?.afterId ?? '';\n const rows = await this.persistence.transaction(tx => tx.discoverRuns(command.scope,command.policyHash,afterId,command.limit));\n if (rows.length > command.limit) failed();\n const candidates: WorkflowGraphDiscoveryCandidate[] = [];\n let previous = afterId;\n for (const row of rows) {\n const id = hash(row); if (id <= previous) failed(); previous = id;\n const candidate = await this.persistence.transaction(async tx => {\n // Do not use SKIP LOCKED: a selected parent is either validated or fails this entire page.\n const run = await this.load(tx,command.scope,id,command.policyHash,false,2);\n if (!run) failed();\n if (run.state.status !== 'running' && run.state.status !== 'waiting' && run.state.status !== 'paused') return undefined;\n return { reference:{kind:'scheduled-workflow' as const,runId:id,definitionHash:run.row.definition_hash,policyHash:command.policyHash},\n version:storedInteger(run.row.version),status:run.state.status };\n });\n if (candidate) candidates.push(candidate);\n }\n return workflowGraphDiscoveryPage({ candidates,examined:rows.length,nextCursor:rows.length === command.limit\n ? {format:1,scope:command.scope,policyHash:command.policyHash,afterId:previous} : null },command);\n } catch { return failed(); }\n }\n /** Internal finite maintenance; validates the full enrolled source before publishing old terminal state. */\n async materializeCompletion(scope: string, reference: ExecutionRef): Promise<ExecutionCompletion | undefined> {\n if (!this.initialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize scheduled workflow storage first.');\n return this.persistence.transaction(async tx => {\n const run = await this.load(tx,scope,reference.runId,reference.policyHash);\n if (!run) throw new StorageError('NOT_FOUND','Workflow was not found in this scope.');\n if (run.row.definition_hash !== reference.definitionHash) conflict();\n return checkCompletion(tx,run.row,reference.policyHash,run.state.status,true);\n });\n }\n private async enroll(tx: Session,row: AggregateRow,input: JsonObject,now: number): Promise<LockedRun> {\n const manifest = input['manifest'] as unknown as Manifest; const policy = input['policy'] as unknown as WorkflowPolicyManifest;\n const resources = input['resources'] as unknown as WorkflowResourcePlan; const hashes = this.hashEnrollment(manifest,policy,resources);\n if (hashes.scope !== row.scope || hashes.definition !== row.definition_hash) conflict();\n const existingState = graphManifest(manifest) ? workflowGraphState(aggregateRecord(row)) : workflowState(aggregateRecord(row));\n if (existingState.policy !== hashes.policy || existingState.maxCostMicros !== policy.maxCostMicros) conflict();\n const profile = graphManifest(manifest) ? 2 : 1;\n const owner: Owner = {format:profile,manifest,policy,resources,clockFloor:now,commands:[]}; const state = this.checkedState(row,owner);\n if (state.status !== 'running' || state.spentMicros !== 0 || state.reservedMicros !== 0 || state.output !== null || Object.values(state.steps).some(step => step.status !== 'pending' || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0 || step.output !== null)) conflict();\n if (await tx.runHasJobs(row.scope,row.id)) conflict();\n const ownerRow: OwnerRow = {scope:row.scope,aggregate_id:row.id,profile,aggregate_version:row.version,definition_hash:hashes.definition,policy_hash:hashes.policy,resource_hash:hashes.resources,data:JSON.stringify(object(owner))};\n await tx.insertOwner(ownerRow);\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,state.input) : {};\n return {row,owner,ownerRow,state,jobs:[],clock:{value:now},events:[],waits,facts:{},targetFacts:new Map()};\n }\n private async submit(input: JsonObject, profile: 1 | 2): Promise<unknown> {\n const manifest = input['manifest'] as unknown as Manifest; const policy = input['policy'] as unknown as WorkflowPolicyManifest; const resources = input['resources'] as unknown as WorkflowResourcePlan;\n const hashes = this.hashEnrollment(manifest,policy,resources); const key = input['idempotencyKey'] as string;\n const id = digest('mayura:run-id:v1',{scope:hashes.scope,submissionKey:key}); jsonValue(input['input'],{maxBytes:policy.maxOutputBytes});\n const state = graphManifest(manifest) ? initialWorkflowGraphState(manifest,input['input']!,hashes.definition,hashes.policy,policy.maxCostMicros)\n : initialWorkflowState(manifest,input['input']!,hashes.definition,hashes.policy,policy.maxCostMicros);\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,state.input) : {};\n // Resolve every edge before parent creation, using independent target-only transactions.\n // No API may attach or mutate graph edges later, so every edge points to an earlier run.\n for (const targets of Object.values(waits)) for (const target of targets) {\n if (target.runId === id || target.policyHash !== hashes.policy) conflict();\n await this.materializeCompletion(hashes.scope,target);\n }\n return this.persistence.transaction(async tx => {\n await tx.lockRunIdentity(hashes.scope,id); await tx.aggregate(hashes.scope,id,false);\n const now = await storageClock(tx);\n const created = await tx.createAggregate(createCommand({scope:hashes.scope,id,idempotencyKey:key,definitionHash:hashes.definition,state:jsonValue(state) as JsonObject,events:[{type:'run.created',data:{}}]}),now);\n if (!created.created) {\n const run = await this.load(tx,hashes.scope,id,hashes.policy,false,profile); if (!run || run.ownerRow.resource_hash !== hashes.resources) conflict();\n return {snapshot:this.snapshot(run),created:false};\n }\n const run = await this.enroll(tx,created.row,input,now);\n for (const [nodeId,targets] of Object.entries(waits)) {\n for (const [ordinal,target] of targets.entries()) {\n await this.checkTargetIdentity(tx,hashes.scope,id,hashes.policy,target);\n await tx.insertWaitTarget({scope:hashes.scope,aggregate_id:id,node_id:nodeId,ordinal,run_id:target.runId,definition_hash:target.definitionHash,policy_hash:target.policyHash});\n }\n run.events.push({type:'workflow.wait_registered',data:{nodeId}});\n }\n if (profile === 2 && !this.admitsOutput(run,null)) throw new StorageError('LIMIT_EXCEEDED','Workflow graph cannot retain its bounded future control evidence.');\n await this.save(tx,run,undefined,undefined,{type:'workflow.enrolled',data:{profile:profile === 1 ? 'scheduled-v1' : 'scheduled-v2'}});\n return {snapshot:this.snapshot(run),created:true};\n });\n }\n async execute(method: ScheduledMethod,value: unknown,profile: 1 | 2 = 1): Promise<unknown> {\n const input = scheduledCommand(method,value,profile);\n if (method === 'initialize') return this.initialize();\n if (!this.initialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize scheduled workflow storage before use.');\n if (method === 'submit') return this.submit(input,profile);\n if (method === 'claim') return this.claim(input,profile);\n const result = await this.persistence.transaction(async tx => {\n const scope = input['scope'] as string; const id = input['id'] as string; const policyHash = input['policyHash'] as string;\n let run: LockedRun;\n if (method === 'attach') {\n await tx.lockRunIdentity(scope,id); const row = await tx.aggregate(scope,id,false);\n if (!row) throw new StorageError('NOT_FOUND','Workflow was not found in this scope.');\n const exists = await tx.ownedRun(scope,id);\n if (exists) { const previous = await this.load(tx,scope,id,policyHash,false,profile); if (!previous || !this.retry(previous,method,input)) conflict(); return this.snapshot(previous); }\n if (storedInteger(row.version) !== input['expectedVersion']) conflict();\n const hashes = this.hashEnrollment(input['manifest'] as unknown as WorkflowManifest,input['policy'] as unknown as WorkflowPolicyManifest,input['resources'] as unknown as WorkflowResourcePlan);\n if (hashes.policy !== policyHash) conflict();\n run = await this.enroll(tx,row,input,await storageClock(tx));\n await this.save(tx,run,method,input,{type:'workflow.enrolled',data:{profile:'scheduled-v1'}}); return this.snapshot(run);\n }\n run = (await this.load(tx,scope,id,policyHash,false,profile))!;\n const originalState = JSON.stringify(run.state);\n if (method === 'inspect') return this.snapshot(run);\n if (this.retry(run,method,input)) return method === 'start' ? {status:'already_started',snapshot:this.snapshot(run)} : this.snapshot(run);\n if (input['expectedVersion'] !== undefined && input['expectedVersion'] !== storedInteger(run.row.version)) conflict();\n if (method === 'recordReceipt') {\n const job = this.job(run,input); const node = this.node(run,job.nodeId); const prior = await this.accounting(tx,run,job,node);\n const result = await this.local(tx,run).execute('recordReceipt',{scope,jobId:job.jobId,fence:input['fence'],evidenceId:input['evidenceId'],receipt:input['receipt'],\n ...(input['settlement'] === undefined ? {} : {settlement:input['settlement']}),\n ...(input['source'] === undefined ? {} : {source:input['source']})}) as {disposition:EvidenceDisposition;job:JobRecord};\n if (run.events.length === 0) return this.snapshot(run);\n this.replaceJob(run,result.job); const step = run.state.steps[job.nodeId]!; const receipt = input['receipt'] as unknown as ExecutionReceipt;\n if (result.disposition !== 'conflicting') {\n step.receipt = mergeWorkflowReceipt(step.receipt,receipt);\n const projected = await this.accounting(tx,run,result.job,node); if (!projected) failed();\n const priorKnown = prior?.settlement.knownCostMicros ?? 0;\n if (projected.settlement.knownCostMicros < priorKnown) failed();\n run.state.spentMicros = nextCounter(run.state.spentMicros,projected.settlement.knownCostMicros-priorKnown);\n run.state.reservedMicros -= step.costReserved; step.costReserved = projected.settlement.unknownCostMicros;\n run.state.reservedMicros = nextCounter(run.state.reservedMicros,step.costReserved);\n }\n this.mirrorJob(run,result.job); await this.save(tx,run); return this.snapshot(run);\n }\n if (method === 'requestApproval' || method === 'approve' || method === 'prepare' || method === 'failNode') {\n const node = this.node(run,input['nodeId'] as string); const previous = run.state.steps[node.id]!;\n const expired = node.approval && previous.approval !== null && previous.approval.expiresAt <= run.clock.value;\n if (expired && method !== 'failNode' && (method !== 'requestApproval' || run.jobs.some(job => job.nodeId === node.id))) {\n await this.observeReviewExpiry(tx,run,node.id); return REVIEW_EXPIRED;\n }\n const step = this.unprepared(run,node,method === 'approve');\n if (method === 'requestApproval') {\n if (!node.approval || !this.authorized(run,node)) conflict();\n if (step.approval && step.approval.expiresAt > run.clock.value && step.approval.digest === this.candidate(run,node,input['input']!,step.approval.expiresAt)) return this.snapshot(run);\n let expiresAt: number; let candidate: string;\n try { expiresAt = nextCounter(run.clock.value,run.owner.policy.approvalTtlMs); candidate = this.candidate(run,node,input['input']!,expiresAt); }\n catch (error) { if (!expired) throw error; await this.observeReviewExpiry(tx,run,node.id); return REVIEW_EXPIRED; }\n step.approval = {digest:candidate,expiresAt,humanId:null}; step.status = 'waiting'; run.state.status = 'waiting';\n } else if (method === 'approve') {\n if (!node.approval || step.status !== 'waiting' || !step.approval || step.approval.digest !== input['digest'] || step.approval.expiresAt <= run.clock.value) conflict();\n step.approval.humanId = input['humanId'] as string; step.status = 'approved'; if (run.state.status !== 'paused') run.state.status = 'running';\n } else if (method === 'failNode') { step.status = input['outcome'] as 'failed'|'blocked'; }\n else {\n if (!this.authorized(run,node)) conflict();\n const expiresAt = node.approval ? step.approval?.expiresAt ?? 0 : null; const candidate = this.candidate(run,node,input['input']!,expiresAt);\n if (node.approval && (step.status !== 'approved' || !step.approval?.humanId || step.approval.digest !== candidate || step.approval.expiresAt <= run.clock.value)) conflict();\n if (node.costMicros > run.state.maxCostMicros - run.state.spentMicros - run.state.reservedMicros) { step.status = 'blocked'; }\n else {\n const jobId = digest('mayura:workflow-job:v1',{scope,id,nodeId:node.id});\n const job = (await this.local(tx,run).execute('reserve',{scope,jobId,reservationKey:jobId,runId:id,nodeId:node.id,invocationId:`${id}/${step.callId}`,definitionHash:run.ownerRow.definition_hash,candidateHash:candidate,\n intent:{toolId:node.tool,callId:`${id}/${step.callId}`,policyHash},resourceKeys:run.owner.resources[node.id]!,delayMs:0}) as {job:JobRecord}).job;\n await tx.insertLink(scope,id,node.id,jobId);\n step.candidateHash = candidate; step.costReserved = node.costMicros; run.state.reservedMicros = nextCounter(run.state.reservedMicros,node.costMicros);\n this.replaceJob(run,job);\n }\n }\n await this.save(tx,run,method,input,{type:method === 'requestApproval' ? 'approval.requested' : method === 'approve' ? 'approval.resolved' : method === 'prepare' ? 'step.prepared' : 'step.failed',data:{nodeId:node.id}});\n return this.snapshot(run);\n }\n if (method === 'start' || method === 'renew' || method === 'complete' || method === 'abandon') {\n const job = this.job(run,input); const token = input['claim'] as unknown as Claim; const step = run.state.steps[job.nodeId]!; const node = this.node(run,job.nodeId);\n const admissionExpiresAt = node.approval ? step.approval?.expiresAt ?? 0 : undefined;\n if (method !== 'renew' && terminalRuns.has(run.state.status)) conflict();\n if (await this.blockExpiredReview(tx,run,job)) { await this.save(tx,run); return STALE; }\n try {\n if (method === 'renew') {\n const renewed = await this.local(tx,run,job.jobId,admissionExpiresAt).execute('renew',{claim:token,leaseMs:input['leaseMs']}) as Claim;\n await this.refreshJob(tx,run,job.jobId); await this.save(tx,run); return renewed;\n }\n if (method === 'start') {\n if (!this.authorized(run,node) || this.candidate(run,node,input['input']!,node.approval ? step.approval?.expiresAt ?? 0 : null) !== step.candidateHash) conflict();\n this.ready(run,node);\n if (node.approval && (step.status !== 'approved' && step.status !== 'dispatching' || !step.approval?.humanId || step.approval.expiresAt <= run.clock.value)) conflict();\n const started = await this.local(tx,run,job.jobId,admissionExpiresAt).execute('start',{claim:token,candidateHash:step.candidateHash}) as {status:'started'|'already_started';job:JobRecord};\n this.replaceJob(run,started.job);\n if (started.status === 'already_started') return {status:'already_started',snapshot:this.snapshot(run)};\n step.status = 'dispatching'; run.state.status = 'running'; await this.save(tx,run,method,input,{type:'step.dispatching',data:{nodeId:node.id}});\n return {status:'started',snapshot:this.snapshot(run)};\n }\n if (method === 'abandon') {\n // A live renewal validates the precise never-started token without manufacturing a start marker.\n if (job.startedAtMs !== null || job.state !== 'leased') conflict();\n await this.local(tx,run,job.jobId,admissionExpiresAt).execute('renew',{claim:token,leaseMs:1000});\n await this.cancelJob(tx,run,job,digest('mayura:scheduled-internal-command:v1',{operation:'abandon',commandId:input['commandId']})); step.status = input['outcome'] as 'failed'|'blocked';\n } else {\n if (step.status !== 'dispatching') conflict();\n const outputAllowed = input['outcome'] !== 'succeeded' || this.admitsOutput(run,input['output']!,node.id);\n const outcome = outputAllowed ? input['outcome'] as 'succeeded'|'failed'|'blocked' : 'blocked';\n const completed = await this.local(tx,run).execute('complete',{claim:token,commandId:input['commandId'],evidenceId:input['evidenceId'],outcome,output:outcome === 'succeeded' ? input['output'] : null}) as JobRecord;\n this.replaceJob(run,completed); step.receipt = completed.receipt; step.status = outcome; step.output = completed.output;\n if (!outputAllowed) run.events.push({type:'step.output_blocked',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}});\n if (step.costReserved > 0 && step.receipt && step.receipt.execution !== 'unknown') this.refund(run,step,step.receipt.execution !== 'not_started');\n }\n await this.save(tx,run,method,input,{type:'step.completed',data:{nodeId:node.id,outcome:step.status}}); return this.snapshot(run);\n } catch (error) {\n if (!(error instanceof StorageError) || error.storageCode !== 'STALE_CLAIM') throw error;\n await this.blockExpiredReview(tx,run,job);\n if (run.events.length > 0) { this.mirrorJob(run,await this.refreshJob(tx,run,job.jobId)); await this.save(tx,run); }\n return STALE;\n }\n }\n if (method === 'cancel') {\n if (!terminalRuns.has(run.state.status)) {\n run.state.status = 'cancelled'; run.state.output = null;\n for (const job of [...run.jobs]) await this.cancelJob(tx,run,job,digest('mayura:scheduled-internal-command:v1',{operation:'cancel',commandId:input['commandId']}));\n for (const [nodeId,step] of Object.entries(run.state.steps)) if (!run.jobs.some(job => job.nodeId === nodeId) && !terminalSteps.has(step.status)) step.status = 'skipped';\n }\n } else if (method === 'recover') {\n for (const job of [...run.jobs]) {\n if (await this.blockExpiredReview(tx,run,job)) continue;\n const recovered = await this.local(tx,run,job.jobId).execute('recover',{scope,limit:1}) as JobRecord[];\n for (const item of recovered) { this.replaceJob(run,item); this.mirrorJob(run,item); }\n }\n this.advance(run);\n } else if (method === 'pause') {\n if (run.state.status !== 'paused') {\n if (terminalRuns.has(run.state.status)) conflict();\n // Quiescence: a claimed or started job must settle, be released or be recovered first.\n if (run.jobs.some(job => job.state === 'leased' || job.state === 'started')) conflict();\n run.state.status = 'paused';\n }\n } else if (method === 'resume') {\n if (run.state.status !== 'paused') conflict();\n run.state.status = 'running'; this.advance(run);\n } else if (method === 'migrate') {\n await this.migrateRun(tx,run,input);\n await this.save(tx,run,method,input,{type:'run.migrated',data:{migrationId:input['migrationId']!,from:run.owner.lineage!.at(-1)!,to:run.ownerRow.definition_hash,actorId:input['actorId']!,commandId:input['commandId']!}});\n return this.snapshot(run);\n } else if (method === 'advance') this.advance(run);\n else if (method === 'finalize') {\n if (terminalRuns.has(run.state.status) || run.state.status === 'paused' || Object.values(run.state.steps).some(step => step.status !== 'succeeded') || run.state.reservedMicros !== 0) conflict();\n if (input['validation'] === 'passed' && this.admitsOutput(run,input['output']!)) { run.state.output = input['output']!; run.state.status = 'succeeded'; }\n else { run.state.output = null; run.state.status = 'failed'; }\n } else conflict();\n // A no-op is not a committed transition, so it consumes neither a version nor a command journal entry.\n if (run.events.length === 0 && JSON.stringify(run.state) === originalState) return this.snapshot(run);\n const transition = method === 'cancel' ? 'run.cancelled' : method === 'finalize' ? 'run.completed'\n : method === 'pause' ? 'run.paused' : method === 'resume' ? 'run.resumed' : 'workflow.advanced';\n await this.save(tx,run,method,input,{type:transition,data:{status:run.state.status}});\n return this.snapshot(run);\n });\n if (result === STALE) throw new StorageError('STALE_CLAIM','Scheduled ownership expired or no longer permits the transition.');\n // Keep this text in sync with reviewExpiredMessage in @mayura/workflows: the driver recognizes it.\n if (result === REVIEW_EXPIRED) throw new StorageError('CONFLICT','The approval expired; request a new review before admission.');\n return result;\n }\n private async claim(input: JsonObject, profile: 1 | 2): Promise<unknown> {\n const scope = input['scope'] as string; const id = input['id'] as string; const policy = input['policyHash'] as string;\n const hints = await this.persistence.transaction(async tx => { const run = await this.load(tx,scope,id,policy,false,profile); return run?.jobs.filter(job => job.state === 'ready').map(job => job.jobId) ?? []; });\n const results: {job:JobRecord;claim:Claim}[] = [];\n for (const jobId of hints) {\n if (results.length >= (input['limit'] as number)) break;\n try {\n const result = await this.persistence.transaction(async tx => {\n // This is an explicit run request, not a global queue scan: skipping its busy aggregate\n // can make every cooperating worker return while eligible work is still ready.\n const run = await this.load(tx,scope,id,policy,false,profile); if (!run || terminalRuns.has(run.state.status) || run.state.status === 'paused') return undefined;\n const job = run.jobs.find(job => job.jobId === jobId); if (!job || job.state !== 'ready') return undefined;\n if (await this.blockExpiredReview(tx,run,job)) { await this.save(tx,run); return undefined; }\n const claims = await this.local(tx,run,jobId).execute('claim',{scope,workerId:input['workerId'],limit:1,leaseMs:input['leaseMs']}) as {job:JobRecord;claim:Claim}[];\n if (!claims[0]) return undefined; this.replaceJob(run,claims[0].job);\n // Resource acquisition can wait; recheck review expiry using the scheduler's post-lock clock.\n if (await this.blockExpiredReview(tx,run,claims[0].job)) { await this.save(tx,run); return undefined; }\n await this.save(tx,run); return claims[0];\n });\n if (result) results.push(result);\n } catch (error) { if (!(error instanceof ResourceBusy)) throw error; }\n }\n return results;\n }\n}\n"]}
1
+ {"version":3,"file":"scheduled-database.js","sourceRoot":"","sources":["../src/scheduled-database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoF,MAAM,cAAc,CAAC;AAC3H,OAAO,EACL,kCAAkC,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EACpG,gBAAgB,EAAE,cAAc,EAAE,iBA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C,CAAC;oBAC7F,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAC,GAAG,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,EAAC,EAAC,KAAK,EAAC,QAAQ,EAAC,KAAK,CAAC,UAAU,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,OAAO,EAAC,KAAK,CAAC,SAAS,CAAC,EAAC,CAAkC,CAAC;oBACpK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;wBAAE,OAAO,SAAS,CAAC;oBAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;oBACrE,8FAA8F;oBAC9F,IAAI,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAC,GAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,GAAG,CAAC,CAAC;wBAAC,OAAO,SAAS,CAAC;oBAAC,CAAC;oBACvG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,GAAG,CAAC,CAAC;oBAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;gBACH,IAAI,MAAM;oBAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,IAAI,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC;oBAAE,MAAM,KAAK,CAAC;YAAC,CAAC;QACxE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { jsonValue, type ExecutionReceipt, type ExecutionSettlement, type JsonObject, type JsonValue } from '@mayura/core';\nimport {\n assertWorkflowStateMatchesManifest, initialWorkflowState, mergeWorkflowReceipt, workflowHashMaterial,\n workflowManifest, workflowPolicy, workflowResources, workflowState,\n type Claim, type EvidenceDisposition, type JobRecord, type ScheduledWorkflowSnapshot, type SchedulerEvidence,\n type WorkflowFormat2State, type WorkflowFormat2Step, type WorkflowManifest, type WorkflowManifestNode,\n type WorkflowPolicyManifest, type WorkflowResourcePlan, type ExecutionRef, type ExecutionCompletion,\n workflowGraphManifest, workflowGraphState, workflowGraphResources, workflowGraphTargets, initialWorkflowGraphState,\n assertWorkflowGraphStateMatchesManifest, type WorkflowGraphManifest, type WorkflowGraphManifestNode,\n type WorkflowGraphFormat3State, type WorkflowGraphFormat3Step, type WorkflowGraphStoreSnapshot,\n workflowGraphDiscoveryCommand, workflowGraphDiscoveryPage,\n type WorkflowGraphDiscoveryStore, type WorkflowGraphDiscoveryScan, type WorkflowGraphDiscoveryCandidate,\n} from '@mayura/storage-contracts';\nimport { StorageError, type StoredEventInput } from './contracts.js';\nimport { aggregateRecord, storedInteger, type AggregateRow } from './aggregate-session.js';\nimport { ResourceBusy, SchedulerDatabase, type SchedulerBackend } from './scheduler-database.js';\nimport { fields, hash, integer, object } from './scheduler-validation.js';\nimport { scheduledCommand, type ScheduledMethod } from './scheduled-validation.js';\nimport { createCommand, identifier, nextCounter } from './validation.js';\nimport { checkCompletion, completionOf } from './execution-completions.js';\nimport { sha256Hex } from '@mayura/core/host';\nimport { sqlScheduledPersistence, type ScheduledPersistence, type ScheduledTransaction, type WorkflowOwnerRow, type WorkflowWaitTargetRow } from './scheduled-persistence.js';\n\ninterface Journal { id: string; digest: string; version: number; operation: string }\ninterface Owner {\n format: 1 | 2; manifest: Manifest; policy: WorkflowPolicyManifest; resources: WorkflowResourcePlan;\n clockFloor: number; commands: Journal[];\n /** Definition digests this run was migrated from, oldest first. Job history pinned to them stays valid. */\n lineage?: string[];\n}\ntype OwnerRow = WorkflowOwnerRow;\ntype WaitTargetRow = WorkflowWaitTargetRow;\ntype Session = ScheduledTransaction;\ntype Manifest = WorkflowManifest | WorkflowGraphManifest;\ntype Node = WorkflowManifestNode | WorkflowGraphManifestNode;\ntype State = WorkflowFormat2State | WorkflowGraphFormat3State;\ntype Step = WorkflowFormat2Step | WorkflowGraphFormat3Step;\ntype Snapshot = ScheduledWorkflowSnapshot | WorkflowGraphStoreSnapshot;\ntype WaitTargets = Readonly<Record<string, readonly ExecutionRef[]>>;\ninterface LockedRun {\n row: AggregateRow; owner: Owner; ownerRow: OwnerRow; state: State;\n jobs: JobRecord[]; clock: { value: number }; events: StoredEventInput[];\n waits: WaitTargets; facts: Readonly<Record<string, readonly ExecutionCompletion[] | undefined>>;\n /** Transaction-local observations only; even absent facts are re-read by the next command. */\n targetFacts: Map<string, ExecutionCompletion | undefined>;\n}\ntype ToolNode = Extract<WorkflowManifestNode, { kind: 'tool' }>;\nconst terminalSteps = new Set(['succeeded','failed','blocked','unknown','skipped']);\nconst terminalRuns = new Set(['succeeded','failed','blocked','outcome_unknown','cancelled']);\nconst STALE = Symbol('scheduled-stale');\nconst REVIEW_EXPIRED = Symbol('scheduled-review-expired');\nfunction failed(): never { throw new StorageError('STORAGE_UNAVAILABLE', 'Stored scheduled workflow failed integrity validation.'); }\nfunction conflict(): never { throw new StorageError('CONFLICT', 'Scheduled workflow state or command content changed.'); }\nfunction limited(): never { throw new StorageError('LIMIT_EXCEEDED', 'Scheduled workflow history or output limit was reached.'); }\nfunction digest(domain: string, value: unknown): string { return sha256Hex(workflowHashMaterial(domain, value)); }\nfunction same(a: unknown, b: unknown): boolean { return workflowHashMaterial('compare', a) === workflowHashMaterial('compare', b); }\nfunction graphManifest(manifest: Manifest): manifest is WorkflowGraphManifest { return 'format' in manifest && manifest.format === 3; }\n/** The store's time, never earlier than `floor`. */\nasync function storageClock(tx: Session, floor = 0): Promise<number> { return Math.max(floor, storedInteger(await tx.clock())); }\ninterface AccountingProjection { readonly receipt: ExecutionReceipt; readonly settlement: ExecutionSettlement }\n\nfunction executionSettlement(value: ExecutionSettlement | undefined, receipt: ExecutionReceipt, maximum: number): ExecutionSettlement {\n const fallback = receipt.execution === 'unknown' ? {knownCostMicros:0,unknownCostMicros:maximum}\n : receipt.execution === 'not_started' ? {knownCostMicros:0,unknownCostMicros:0}\n : {knownCostMicros:maximum,unknownCostMicros:0};\n const result = value ?? fallback;\n if (!Number.isSafeInteger(result.knownCostMicros) || result.knownCostMicros < 0\n || !Number.isSafeInteger(result.unknownCostMicros) || result.unknownCostMicros < 0\n || result.knownCostMicros > maximum - result.unknownCostMicros\n || (receipt.execution !== 'unknown' && result.unknownCostMicros !== 0)\n || (receipt.execution === 'not_started' && result.knownCostMicros !== 0)) failed();\n return Object.freeze({knownCostMicros:result.knownCostMicros,unknownCostMicros:result.unknownCostMicros});\n}\n\n/** Finite integrated reducer. Every mutation uses its caller-owned connection/transaction. */\nexport class ScheduledWorkflowDatabase {\n private initialized = false;\n private discoveryInitialized = false;\n private readonly persistence: ScheduledPersistence;\n constructor(backend: SchedulerBackend | ScheduledPersistence, private readonly scheduler: SchedulerDatabase) {\n this.persistence = 'dialect' in backend ? sqlScheduledPersistence(backend) : backend;\n }\n private hashEnrollment(manifest: Manifest, policy: WorkflowPolicyManifest, resources: WorkflowResourcePlan) {\n return { scope: digest('mayura:scope:v1',policy.scope), definition: digest(graphManifest(manifest) ? 'mayura:workflow:v2' : 'mayura:workflow:v1',manifest),\n policy: digest('mayura:policy:v1',policy), resources: digest('mayura:workflow-resources:v1',resources) };\n }\n private decode(row: OwnerRow, aggregate: AggregateRow): Owner {\n try {\n if (![1,2].includes(Number(row.profile)) || row.scope !== aggregate.scope || row.aggregate_id !== aggregate.id || storedInteger(row.aggregate_version) !== storedInteger(aggregate.version)) failed();\n const raw = object(JSON.parse(row.data));\n fields(raw,Object.hasOwn(raw,'lineage') ? ['format','manifest','policy','resources','clockFloor','commands','lineage'] : ['format','manifest','policy','resources','clockFloor','commands']);\n const lineage = raw['lineage'] === undefined ? undefined : raw['lineage'];\n if (lineage !== undefined && (!Array.isArray(lineage) || lineage.length < 1 || lineage.length > 64 || lineage.some(item => typeof item !== 'string' || !/^[a-f0-9]{64}$/.test(item)))) failed();\n if (raw['format'] !== Number(row.profile)) failed(); integer(raw['clockFloor']);\n const manifest = raw['format'] === 2 ? workflowGraphManifest(raw['manifest']) : workflowManifest(raw['manifest']);\n const policy = workflowPolicy(raw['policy']);\n const resources = graphManifest(manifest) ? workflowGraphResources(raw['resources'],manifest) : workflowResources(raw['resources'],manifest);\n if (!same(manifest,raw['manifest']) || !same(policy,raw['policy']) || !same(resources,raw['resources'])) failed();\n const hashes = this.hashEnrollment(manifest,policy,resources);\n if (hashes.scope !== aggregate.scope || hashes.definition !== aggregate.definition_hash || hashes.definition !== row.definition_hash || hashes.policy !== row.policy_hash || hashes.resources !== row.resource_hash) failed();\n if (!Array.isArray(raw['commands']) || raw['commands'].length > 1024) failed();\n const ids = new Set<string>(); let lastVersion = 0;\n for (const entry of raw['commands']) {\n const command = object(entry); fields(command,['id','digest','version','operation']);\n const id = identifier(command['id'],'Stored command'); if (ids.has(id)) failed(); ids.add(id);\n hash(command['digest']); identifier(command['operation'],'Stored operation'); integer(command['version'],1,storedInteger(aggregate.version));\n if ((command['version'] as number) <= lastVersion) failed(); lastVersion = command['version'] as number;\n }\n return { format: raw['format'] as 1 | 2, manifest, policy, resources, clockFloor: raw['clockFloor'] as number, commands: raw['commands'] as unknown as Journal[],\n ...(lineage === undefined ? {} : { lineage: lineage as string[] }) };\n } catch { return failed(); }\n }\n private checkedState(row: AggregateRow, owner: Owner): State {\n try {\n let state: State;\n if (graphManifest(owner.manifest)) { state = workflowGraphState(aggregateRecord(row)); assertWorkflowGraphStateMatchesManifest(state,owner.manifest); }\n else { state = workflowState(aggregateRecord(row)); assertWorkflowStateMatchesManifest(state,owner.manifest); }\n const hashes = this.hashEnrollment(owner.manifest,owner.policy,owner.resources);\n if (state.definition !== hashes.definition || state.policy !== hashes.policy || state.maxCostMicros !== owner.policy.maxCostMicros) failed();\n jsonValue(state.input,{maxBytes:owner.policy.maxOutputBytes}); jsonValue(state.output,{maxBytes:owner.policy.maxOutputBytes});\n for (const step of Object.values(state.steps)) jsonValue(step.output,{maxBytes:owner.policy.maxOutputBytes});\n return state;\n } catch { return failed(); }\n }\n private async load(tx: Session, scope: string, id: string, policyHash: string, skip = false, profile?: 1 | 2): Promise<LockedRun | undefined> {\n const row = await tx.aggregate(scope,id,skip);\n if (!row) { if (skip) return undefined; throw new StorageError('NOT_FOUND','Workflow was not found in this scope.'); }\n const ownerRow = await tx.owner(scope,id);\n if (!ownerRow) throw new StorageError('SCHEDULED_WRITER_REQUIRED','The run is not enrolled in scheduled execution.');\n if (profile !== undefined && Number(ownerRow.profile) !== profile) conflict();\n const owner = this.decode(ownerRow,row); if (ownerRow.policy_hash !== policyHash) conflict();\n const state = this.checkedState(row,owner);\n // Lock every bounded owned job before touching any resource. Controls can safely visit them in any order afterwards.\n const jobIds = await tx.lockRunJobs(scope,id);\n const links = await tx.links(scope,id);\n if (links.length > owner.manifest.graph.length || links.length !== jobIds.length || links.some((link,index) => link.job_id !== jobIds[index])) failed();\n const events: StoredEventInput[] = []; const clock = { value: owner.clockFloor }; const jobs: JobRecord[] = [];\n const local = this.scheduler.inSession(tx,id,events,undefined,clock);\n for (const link of links) {\n const job = await local.execute('read',{scope,jobId:link.job_id}) as JobRecord | undefined;\n const node = owner.manifest.graph.find(node => node.id === link.node_id); const step = state.steps[link.node_id];\n if (!job || !node || node.kind !== 'tool' || !step || job.nodeId !== node.id || job.runId !== id\n || (job.definitionHash !== row.definition_hash && !owner.lineage?.includes(job.definitionHash)) || job.candidateHash !== step.candidateHash\n || job.intent['toolId'] !== node.tool || job.intent['callId'] !== `${id}/${step.callId}`\n || job.intent['policyHash'] !== policyHash || !same(job.resourceKeys,owner.resources[node.id])) failed();\n if (job.state === 'succeeded' && (step.status !== 'succeeded' || !same(step.output,job.output) || !same(step.receipt,job.receipt))) failed();\n if (['ready','leased'].includes(job.state) && !['pending','approved'].includes(step.status)) failed();\n if (job.state === 'started' && step.status !== 'dispatching') failed();\n jobs.push(job);\n }\n for (const [nodeId,step] of Object.entries(state.steps)) if (step.candidateHash !== null && !links.some(link => link.node_id === nodeId)) failed();\n clock.value = await storageClock(tx,clock.value);\n const waits = graphManifest(owner.manifest) ? workflowGraphTargets(owner.manifest,state.input) : {};\n const run: LockedRun = { row,owner,ownerRow,state,jobs,clock,events,waits,facts:{},targetFacts:new Map() };\n await this.checkWaitProjection(tx,run);\n await this.checkProjection(tx,run);\n await checkCompletion(tx,row,policyHash,state.status,false); return run;\n }\n /** Parent-owned immutable edges are recomputed from the admitted input, never trusted as a second authority.\n * Only immutable target facts/identity columns are read here; no target workflow lock is acquired.\n */\n private async checkWaitProjection(tx: Session, run: LockedRun): Promise<void> {\n try {\n const rows: WaitTargetRow[] = await tx.waitTargets(run.row.scope,run.row.id);\n const expected = Object.entries(run.waits); const count = expected.reduce((total,[,targets]) => total + targets.length,0);\n if (rows.length !== count || count > 128) failed();\n const seen = new Set<string>();\n for (const row of rows) {\n const ordinal = storedInteger(row.ordinal); const reference = run.waits[row.node_id]?.[ordinal];\n const key = JSON.stringify([row.node_id,ordinal]); if (seen.has(key)) failed(); seen.add(key);\n if (!reference || row.scope !== run.row.scope || row.aggregate_id !== run.row.id || row.run_id !== reference.runId\n || row.definition_hash !== reference.definitionHash || row.policy_hash !== reference.policyHash\n || row.policy_hash !== run.ownerRow.policy_hash || row.run_id === run.row.id) failed();\n }\n const facts: Record<string, readonly ExecutionCompletion[] | undefined> = {};\n for (const [nodeId,targets] of expected) {\n const observations: ExecutionCompletion[] = []; let complete = true;\n for (const reference of targets) {\n const key = JSON.stringify([reference.kind,reference.runId,reference.definitionHash,reference.policyHash]);\n if (!run.targetFacts.has(key)) {\n await this.checkTargetIdentity(tx,run.row.scope,run.row.id,run.ownerRow.policy_hash,reference);\n run.targetFacts.set(key,await completionOf(tx,run.row.scope,reference));\n }\n // Repeated edges retain independent row/order checks above. Only immutable identities\n // and facts share this command-local observation; no target business lock is acquired.\n const fact = run.targetFacts.get(key);\n if (fact) observations.push(fact); else complete = false;\n }\n facts[nodeId] = complete ? observations : undefined;\n const step = run.state.steps[nodeId];\n // A wait can fail only after a complete observation fails output admission.\n // It cannot fabricate terminal failure while any target is still pending.\n if (step?.status === 'failed' && !complete) failed();\n if (!step || step.kind !== 'wait' || run.jobs.some(job => job.nodeId === nodeId)\n || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0) failed();\n if (step.status === 'succeeded' && (!complete || !same(step.output,observations))) failed();\n }\n run.facts = facts;\n } catch { failed(); }\n }\n /** Verify already-existing immutable owner identities without taking target business locks. */\n private async checkTargetIdentity(tx: Session, scope: string, parentId: string, policyHash: string, reference: ExecutionRef): Promise<void> {\n if (reference.runId === parentId || reference.policyHash !== policyHash) conflict();\n const row = await tx.ownerIdentity(scope,reference.runId);\n if (!row || row.scope !== scope || row.aggregate_id !== reference.runId || ![1,2].includes(Number(row.profile))\n || row.definition_hash !== reference.definitionHash || row.policy_hash !== policyHash) conflict();\n }\n /** Independently derive effect facts and accounting from the attempt ledger, never from aggregate claims. */\n private async checkProjection(tx: Session,run: LockedRun): Promise<void> {\n try {\n let spent = 0;\n for (const node of run.owner.manifest.graph) {\n const step = run.state.steps[node.id]!; const job = run.jobs.find(item => item.nodeId === node.id);\n if (!job) {\n if (step.candidateHash !== null || step.receipt !== null || step.costReserved !== 0 || step.status === 'dispatching' || step.status === 'unknown') failed();\n if (node.kind === 'tool' && step.status === 'succeeded') failed();\n if (node.kind === 'join' && step.status === 'succeeded' && !same(step.output,node.dependsOn.map(id => run.state.steps[id]!.output))) failed();\n continue;\n }\n if (node.kind !== 'tool' || step.candidateHash === null) failed();\n const allowed: Record<JobRecord['state'], readonly string[]> = {\n ready: [node.approval ? 'approved' : 'pending'], leased: [node.approval ? 'approved' : 'pending'],\n started: ['dispatching'], succeeded: ['succeeded'], failed: ['failed'], blocked: ['blocked'],\n cancelled: ['skipped','failed','blocked'], outcome_unknown: ['unknown'],\n };\n if (!allowed[job.state].includes(step.status) || (node.approval && !step.approval?.humanId)) failed();\n const accounting = await this.accounting(tx,run,job,node); let projected = accounting?.receipt ?? null;\n if (projected && job.state === 'succeeded') projected = { ...projected,disclosure:'released' };\n if (!same(projected,step.receipt)) failed();\n const expectedReservation = accounting ? accounting.settlement.unknownCostMicros\n : job.startedAtMs === null && ['cancelled','blocked'].includes(job.state) ? 0 : node.costMicros;\n if (step.costReserved !== expectedReservation) failed();\n if (accounting) spent = nextCounter(spent,accounting.settlement.knownCostMicros);\n }\n if (spent !== run.state.spentMicros || (['succeeded','failed','blocked','outcome_unknown'].includes(run.state.status)\n && Object.values(run.state.steps).some(step => !terminalSteps.has(step.status)))) failed();\n } catch { failed(); }\n }\n private snapshot(run: LockedRun): Snapshot {\n return { record: aggregateRecord(run.row), profile:run.owner.format === 1 ? 'scheduled-v1' : 'scheduled-v2', manifestHash:run.ownerRow.definition_hash,\n policyHash:run.ownerRow.policy_hash, resourceHash:run.ownerRow.resource_hash, jobs:run.jobs };\n }\n /** Reconstruct cost facts from immutable attempt evidence; legacy evidence remains conservatively fixed-cost. */\n private async accounting(tx: Session,run: LockedRun,job: JobRecord,node: ToolNode): Promise<AccountingProjection | undefined> {\n if (job.fence === 0) return undefined;\n const evidence = await this.local(tx,run).execute('receipts',{scope:run.row.scope,jobId:job.jobId,fence:job.fence}) as SchedulerEvidence[];\n let projected: AccountingProjection | undefined;\n for (const item of evidence) if (item.disposition !== 'conflicting') {\n const current = executionSettlement(item.settlement,item.receipt,node.costMicros);\n if (!projected) projected = {receipt:mergeWorkflowReceipt(null,item.receipt),settlement:current};\n else {\n const merged = mergeWorkflowReceipt(projected.receipt,item.receipt);\n if (projected.receipt.execution === 'unknown' && item.receipt.execution !== 'unknown') projected = {receipt:merged,settlement:current};\n else if (projected.receipt.execution === 'unknown' && item.receipt.execution === 'unknown' && !same(projected.settlement,current)) {\n const refines = (next: ExecutionSettlement,before: ExecutionSettlement): boolean => next.knownCostMicros >= before.knownCostMicros\n && next.unknownCostMicros <= before.unknownCostMicros\n && next.knownCostMicros + next.unknownCostMicros <= before.knownCostMicros + before.unknownCostMicros;\n if (refines(current,projected.settlement)) projected = {receipt:merged,settlement:current};\n else if (!refines(projected.settlement,current)) failed();\n }\n else {\n if (!same(projected.settlement,current) && !(projected.receipt.execution !== 'unknown' && item.receipt.execution === 'unknown')) failed();\n projected = {receipt:merged,settlement:projected.settlement};\n }\n }\n }\n return projected && Object.freeze({receipt:projected.receipt,settlement:projected.settlement});\n }\n private local(tx: Session, run: LockedRun, jobId?: string, admissionExpiresAt?: number): SchedulerDatabase {\n return this.scheduler.inSession(tx,run.row.id,run.events,jobId,run.clock,admissionExpiresAt);\n }\n private replaceJob(run: LockedRun, job: JobRecord): void {\n const index = run.jobs.findIndex(item => item.jobId === job.jobId); if (index < 0) run.jobs.push(job); else run.jobs[index] = job;\n run.jobs.sort((a,b) => a.jobId < b.jobId ? -1 : a.jobId > b.jobId ? 1 : 0);\n }\n private semantic(method: ScheduledMethod, input: JsonObject): string {\n const value = { ...input }; delete value['expectedVersion'];\n if (value['claim']) { const token = { ...value['claim'] as JsonObject }; delete token['leaseUntilMs']; value['claim'] = token; }\n return digest('mayura:scheduled-command:v1',{ operation:method,...value });\n }\n private retry(run: LockedRun, method: ScheduledMethod, input: JsonObject): boolean {\n if (input['commandId'] === undefined) return false;\n const previous = run.owner.commands.find(item => item.id === input['commandId']);\n if (!previous) return false; if (previous.digest !== this.semantic(method,input) || previous.operation !== method) conflict(); return true;\n }\n private journal(run: LockedRun, method: ScheduledMethod, input: JsonObject): void {\n if (input['commandId'] === undefined) return;\n if (run.owner.commands.length >= 1024) limited();\n run.owner.commands.push({ id:input['commandId'] as string,digest:this.semantic(method,input),version:nextCounter(storedInteger(run.row.version),1),operation:method });\n }\n private async save(tx: Session, run: LockedRun, method?: ScheduledMethod, input?: JsonObject, event?: StoredEventInput): Promise<void> {\n if (method && input) this.journal(run,method,input);\n if (event) run.events.push(event);\n if (run.events.length === 0) run.events.push({type:'workflow.control',data:{operation:method ?? 'projection'}});\n run.owner.clockFloor = run.clock.value;\n const next = jsonValue(run.state) as JsonObject;\n this.checkedState({ ...run.row,state:JSON.stringify(next) },run.owner);\n await this.checkWaitProjection(tx,run);\n await this.checkProjection(tx,run);\n run.row = await tx.writeAggregate(run.row,next,run.events,run.clock.value);\n run.ownerRow.aggregate_version = run.row.version; run.ownerRow.data = JSON.stringify(object(run.owner));\n await tx.updateOwner(run.row.scope,run.row.id,run.row.version,run.ownerRow.data);\n await checkCompletion(tx,run.row,run.ownerRow.policy_hash,run.state.status,true);\n run.events.length = 0;\n }\n /**\n * Apply a reviewed migration to a locked, paused run. Everything is re-verified here: the caller's plan is advisory.\n * Steps with scheduler history and non-pending waits must be unchanged; other steps may only be carried unchanged\n * or re-enter as fresh pending steps. No other run may depend on this run's identity.\n */\n private async migrateRun(tx: Session, run: LockedRun, input: JsonObject): Promise<void> {\n const refuse = (message: string): never => { throw new StorageError('CONFLICT', `Migration refused: ${message}`); };\n if (run.state.status !== 'paused') refuse('the run must be paused.');\n if (run.jobs.some(job => job.state === 'leased' || job.state === 'started')) refuse('a job is leased or started.');\n if (await tx.workflowWaitsOn(run.row.scope,run.row.id)) refuse('another workflow waits on this run.');\n if (await tx.executionWaitTargets(run.row.scope,run.row.id)) refuse('an execution wait targets this run.');\n const manifest = input['manifest'] as unknown as Manifest; const resources = input['resources'] as unknown as WorkflowResourcePlan;\n if (graphManifest(manifest) !== graphManifest(run.owner.manifest)) refuse('the workflow format cannot change.');\n const hashes = this.hashEnrollment(manifest,run.owner.policy,resources);\n if (hashes.definition === run.ownerRow.definition_hash) refuse('the definition is unchanged.');\n const previous = run.state; const next = input['state'] as unknown as State;\n const checked = graphManifest(manifest) ? workflowGraphState({ id: run.row.id, state: next as unknown as JsonObject }) : workflowState({ id: run.row.id, state: next as unknown as JsonObject });\n if (checked.definition !== hashes.definition || checked.policy !== previous.policy || checked.maxCostMicros !== previous.maxCostMicros || checked.status !== 'paused'\n || !same(checked.input,previous.input) || checked.spentMicros !== previous.spentMicros || checked.output !== null) refuse('only steps and the definition may change.');\n const oldNodes = new Map(run.owner.manifest.graph.map(node => [node.id,node])); const newNodes = new Map(manifest.graph.map(node => [node.id,node]));\n for (const [id,step] of Object.entries(checked.steps)) {\n const before = previous.steps[id]; const jobbed = run.jobs.some(job => job.nodeId === id);\n if (before && same(step,before)) {\n // Carried unchanged: a step with history must also keep its exact node definition and resources.\n if ((jobbed || !['pending','skipped'].includes(before.status)) && (!same(oldNodes.get(id),newNodes.get(id)) || !same(run.owner.resources[id] ?? null,resources[id] ?? null))) {\n if (jobbed || before.status === 'waiting' && before.kind === 'wait') refuse(`step \"${id}\" has execution history and its definition changed.`);\n }\n continue;\n }\n if (jobbed) refuse(`step \"${id}\" has scheduler history and cannot change.`);\n if (before && !['pending','waiting','approved'].includes(before.status)) refuse(`settled step \"${id}\" can only be carried unchanged.`);\n if (step.status !== 'pending' || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0) refuse(`step \"${id}\" must re-enter as a fresh pending step.`);\n }\n for (const [id,before] of Object.entries(previous.steps)) {\n if (Object.hasOwn(checked.steps,id)) continue;\n if (run.jobs.some(job => job.nodeId === id && !['cancelled'].includes(job.state)) || before.status === 'dispatching' || before.status === 'unknown') refuse(`step \"${id}\" has execution history and cannot be removed.`);\n }\n // Waits: started wait nodes keep identical targets; the target rows are re-projected from the new manifest.\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,checked.input) : {};\n for (const [nodeId,targets] of Object.entries(run.waits)) {\n const step = previous.steps[nodeId];\n if (step && step.status !== 'pending' && !same(waits[nodeId] ?? null,targets)) refuse(`wait \"${nodeId}\" already started and its targets changed.`);\n }\n await tx.deleteWaitTargets(run.row.scope,run.row.id);\n for (const [nodeId,targets] of Object.entries(waits)) for (const [ordinal,target] of targets.entries()) {\n await this.checkTargetIdentity(tx,run.row.scope,run.row.id,run.ownerRow.policy_hash,target);\n await tx.insertWaitTarget({scope:run.row.scope,aggregate_id:run.row.id,node_id:nodeId,ordinal,run_id:target.runId,definition_hash:target.definitionHash,policy_hash:target.policyHash});\n }\n const lineage = [...(run.owner.lineage ?? []), run.ownerRow.definition_hash];\n if (lineage.length > 64) limited();\n run.owner = { ...run.owner, manifest, resources, lineage };\n run.state = checked; run.waits = waits; run.targetFacts = new Map();\n await tx.redefine(run.row.scope,run.row.id,hashes.definition,hashes.resources);\n run.row = { ...run.row, definition_hash: hashes.definition }; run.ownerRow = { ...run.ownerRow, definition_hash: hashes.definition, resource_hash: hashes.resources };\n }\n private node(run: LockedRun,id: string): ToolNode {\n const node = run.owner.manifest.graph.find(node => node.id === id); if (!node || node.kind !== 'tool') conflict(); return node;\n }\n /** A paused run schedules nothing; only recording an already-requested approval is admitted. */\n private ready(run: LockedRun,node: Node,allowPaused = false): void {\n if (terminalRuns.has(run.state.status) || (run.state.status === 'paused' && !allowPaused)\n || node.dependsOn.some(id => run.state.steps[id]?.status !== 'succeeded')) conflict();\n }\n private unprepared(run: LockedRun,node: ToolNode,allowPaused = false): Step {\n this.ready(run,node,allowPaused); const step = run.state.steps[node.id]!;\n if (run.jobs.some(job => job.nodeId === node.id) || !['pending','waiting','approved'].includes(step.status) || step.receipt || step.costReserved || step.candidateHash) conflict();\n return step;\n }\n private authorized(run: LockedRun,node: ToolNode): boolean {\n return [`tool:${node.tool}`,...node.capabilities,...(node.effects === 'none' ? [] : [`effect:${node.effects}`])].every(grant => run.owner.policy.permissions.includes(grant));\n }\n private candidate(run: LockedRun,node: ToolNode,input: JsonValue,expiresAt: number | null): string {\n try { jsonValue(input,{maxBytes:run.owner.policy.maxOutputBytes}); }\n catch { throw new StorageError('INVALID_INPUT','Candidate input exceeds the pinned workflow limit.'); }\n return digest('mayura:approval:v1',{runId:run.row.id,nodeId:node.id,tool:node.tool,toolVersion:node.toolVersion,input,policy:run.ownerRow.policy_hash,expiresAt});\n }\n private refund(run: LockedRun,step: Step,executed = false): void {\n run.state.reservedMicros -= step.costReserved;\n if (executed) run.state.spentMicros = nextCounter(run.state.spentMicros,step.costReserved);\n step.costReserved = 0;\n }\n private async refreshJob(tx: Session,run: LockedRun,jobId: string): Promise<JobRecord> {\n const job = await this.local(tx,run).execute('read',{scope:run.row.scope,jobId}) as JobRecord | undefined;\n if (!job) failed(); this.replaceJob(run,job); return job;\n }\n private job(run: LockedRun,input: JsonObject): JobRecord {\n const token = input['claim'] as unknown as Claim | undefined; const id = token?.jobId ?? input['jobId'];\n if (token && token.scope !== run.row.scope) conflict();\n const job = run.jobs.find(job => job.jobId === id); if (!job) conflict(); return job;\n }\n private mirrorJob(run: LockedRun,job: JobRecord): void {\n const step = run.state.steps[job.nodeId]!;\n if (job.state === 'outcome_unknown') { step.status = 'unknown'; step.output = null; }\n else if (job.state === 'cancelled' && job.startedAtMs === null) { if (!terminalSteps.has(step.status)) step.status = 'skipped'; this.refund(run,step); }\n else if (job.state === 'blocked' && job.startedAtMs === null) { step.status = 'blocked'; this.refund(run,step); }\n }\n private async cancelJob(tx: Session,run: LockedRun,job: JobRecord,commandId: string): Promise<JobRecord> {\n const result = await this.local(tx,run).execute('cancel',{scope:run.row.scope,jobId:job.jobId,commandId}) as JobRecord;\n this.replaceJob(run,result); this.mirrorJob(run,result); return result;\n }\n private expiredReview(run: LockedRun,job: JobRecord): boolean {\n const node = this.node(run,job.nodeId); const review = run.state.steps[node.id]!.approval;\n return node.approval && (!review || review.expiresAt <= run.clock.value);\n }\n /** Leave room for every future receipt, review identity and control counter before releasing output.\n * A full aggregate must never prevent cancellation or settlement of an already-started effect.\n * Control characters deliberately bound JSON escaping for a maximum-size verified human identity.\n */\n private admitsOutput(run: LockedRun,value: JsonValue,nodeId?: string): boolean {\n try {\n const output = jsonValue(value,{maxBytes:run.owner.policy.maxOutputBytes});\n const steps: Record<string,Step> = {};\n for (const node of run.owner.manifest.graph) {\n const step = { ...run.state.steps[node.id]!,output:node.id === nodeId ? output : run.state.steps[node.id]!.output };\n if (node.kind === 'tool') {\n step.status = 'dispatching'; step.candidateHash = 'f'.repeat(64); step.costReserved = Number.MAX_SAFE_INTEGER;\n step.receipt = {callId:`${run.row.id}/${step.callId}`,toolId:node.tool,execution:'not_started',disclosure:'withheld'};\n step.approval = node.approval ? {digest:'f'.repeat(64),expiresAt:Number.MAX_SAFE_INTEGER,humanId:'\\u0001'.repeat(256)} : null;\n } else {\n step.status = 'succeeded';\n // Every unresolved wait must retain room to settle after earlier tool outputs are admitted.\n // Use the longest terminal spelling and safe-counter widths; references are immutable.\n if (node.kind === 'wait' && node.id !== nodeId && step.output === null) step.output = jsonValue(run.waits[node.id]!.map(reference => ({\n reference, outcome:'outcome_unknown', sourceVersion:Number.MAX_SAFE_INTEGER, sourceEventSequence:Number.MAX_SAFE_INTEGER,\n })));\n }\n steps[node.id] = step;\n }\n // This is a size/depth/node-count projection only, not a persistable execution state.\n jsonValue({...run.state,status:'outcome_unknown',steps,spentMicros:Number.MAX_SAFE_INTEGER,reservedMicros:Number.MAX_SAFE_INTEGER,\n output:nodeId === undefined ? output : run.state.output});\n return true;\n } catch { return false; }\n }\n private async blockExpiredReview(tx: Session,run: LockedRun,job: JobRecord): Promise<boolean> {\n if (job.startedAtMs !== null || !['ready','leased'].includes(job.state) || !this.expiredReview(run,job)) return false;\n await this.cancelJob(tx,run,job,`review-expired:${job.jobId}`); run.state.steps[job.nodeId]!.status = 'blocked';\n run.events.push({type:'approval.expired',data:{nodeId:job.nodeId}}); return true;\n }\n private async observeReviewExpiry(tx: Session,run: LockedRun,nodeId: string): Promise<void> {\n const job = run.jobs.find(item => item.nodeId === nodeId);\n if (job) await this.blockExpiredReview(tx,run,job);\n if (run.events.length === 0 && run.clock.value > run.owner.clockFloor) run.events.push({type:'approval.expiry_observed',data:{nodeId}});\n // A rejected approval is not journaled as a successful command. Its monotonic observation is\n // nevertheless durable, so wall-clock rollback cannot make the same expired digest live again.\n if (run.events.length > 0) await this.save(tx,run);\n }\n private advance(run: LockedRun): void {\n if (terminalRuns.has(run.state.status) || run.state.status === 'paused') return;\n for (let pass = 0; pass < run.owner.manifest.graph.length; pass++) {\n let changed = false;\n for (const node of run.owner.manifest.graph) {\n const step = run.state.steps[node.id]!;\n if (!['pending','waiting','approved'].includes(step.status) || run.jobs.some(job => job.nodeId === node.id)) continue;\n const dependencies = node.dependsOn.map(id => run.state.steps[id]!);\n if (dependencies.some(step => terminalSteps.has(step.status) && step.status !== 'succeeded')) {\n step.status = 'skipped'; changed = true; run.events.push({type:'step.skipped',data:{nodeId:node.id}});\n } else if (node.kind === 'join' && dependencies.every(step => step.status === 'succeeded')) {\n const output = dependencies.map(step => step.output);\n if (this.admitsOutput(run,output,node.id)) { step.output = output; step.status = 'succeeded'; run.events.push({type:'step.completed',data:{nodeId:node.id}}); }\n else { step.output = null; step.status = 'failed'; run.events.push({type:'step.failed',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}}); }\n changed = true;\n } else if (node.kind === 'wait' && dependencies.every(step => step.status === 'succeeded')) {\n const facts = run.facts[node.id];\n if (facts) {\n const output = jsonValue(facts);\n if (this.admitsOutput(run,output,node.id)) {\n step.output = output; step.status = 'succeeded'; run.events.push({type:'workflow.wait_resolved',data:{nodeId:node.id}});\n } else { step.output = null; step.status = 'failed'; run.events.push({type:'step.failed',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}}); }\n changed = true;\n } else if (step.status === 'pending') {\n step.status = 'waiting'; changed = true; run.events.push({type:'workflow.waiting',data:{nodeId:node.id}});\n }\n }\n }\n if (!changed) break;\n }\n const steps = Object.values(run.state.steps);\n if (steps.every(step => terminalSteps.has(step.status)) && !steps.every(step => step.status === 'succeeded')) {\n run.state.status = steps.some(step => step.status === 'unknown') ? 'outcome_unknown' : steps.some(step => step.status === 'blocked') ? 'blocked' : 'failed';\n } else run.state.status = steps.some(step => step.status === 'waiting') && !steps.some(step => step.status === 'dispatching') ? 'waiting' : 'running';\n }\n private async initialize(): Promise<void> {\n if (this.initialized) return; await this.scheduler.execute('initialize',{});\n await this.persistence.initialize(); this.initialized = true;\n }\n /** Discovery provisions its index only when explicitly requested, never as an unindexed fallback. */\n private async initializeDiscovery(): Promise<void> {\n if (this.discoveryInitialized) return;\n await this.initialize();\n await this.persistence.initializeDiscovery();\n this.discoveryInitialized = true;\n }\n /**\n * Finite recovery hints, not a ready queue or execution grant. Selection releases its transaction\n * before each ordinary parent validation; no two parent locks or mutable target locks overlap.\n */\n async discover(method: keyof WorkflowGraphDiscoveryStore, value: unknown): Promise<unknown> {\n const input = workflowGraphDiscoveryCommand(method,value);\n if (method === 'initialize') return this.initializeDiscovery();\n if (!this.discoveryInitialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize workflow graph discovery before use.');\n const command = input as unknown as WorkflowGraphDiscoveryScan;\n try {\n const afterId = command.cursor?.afterId ?? '';\n const rows = await this.persistence.transaction(tx => tx.discoverRuns(command.scope,command.policyHash,afterId,command.limit));\n if (rows.length > command.limit) failed();\n const candidates: WorkflowGraphDiscoveryCandidate[] = [];\n let previous = afterId;\n for (const row of rows) {\n const id = hash(row); if (id <= previous) failed(); previous = id;\n const candidate = await this.persistence.transaction(async tx => {\n // Do not use SKIP LOCKED: a selected parent is either validated or fails this entire page.\n const run = await this.load(tx,command.scope,id,command.policyHash,false,2);\n if (!run) failed();\n if (run.state.status !== 'running' && run.state.status !== 'waiting' && run.state.status !== 'paused') return undefined;\n return { reference:{kind:'scheduled-workflow' as const,runId:id,definitionHash:run.row.definition_hash,policyHash:command.policyHash},\n version:storedInteger(run.row.version),status:run.state.status };\n });\n if (candidate) candidates.push(candidate);\n }\n return workflowGraphDiscoveryPage({ candidates,examined:rows.length,nextCursor:rows.length === command.limit\n ? {format:1,scope:command.scope,policyHash:command.policyHash,afterId:previous} : null },command);\n } catch { return failed(); }\n }\n /** Internal finite maintenance; validates the full enrolled source before publishing old terminal state. */\n async materializeCompletion(scope: string, reference: ExecutionRef): Promise<ExecutionCompletion | undefined> {\n if (!this.initialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize scheduled workflow storage first.');\n return this.persistence.transaction(async tx => {\n const run = await this.load(tx,scope,reference.runId,reference.policyHash);\n if (!run) throw new StorageError('NOT_FOUND','Workflow was not found in this scope.');\n if (run.row.definition_hash !== reference.definitionHash) conflict();\n return checkCompletion(tx,run.row,reference.policyHash,run.state.status,true);\n });\n }\n private async enroll(tx: Session,row: AggregateRow,input: JsonObject,now: number): Promise<LockedRun> {\n const manifest = input['manifest'] as unknown as Manifest; const policy = input['policy'] as unknown as WorkflowPolicyManifest;\n const resources = input['resources'] as unknown as WorkflowResourcePlan; const hashes = this.hashEnrollment(manifest,policy,resources);\n if (hashes.scope !== row.scope || hashes.definition !== row.definition_hash) conflict();\n const existingState = graphManifest(manifest) ? workflowGraphState(aggregateRecord(row)) : workflowState(aggregateRecord(row));\n if (existingState.policy !== hashes.policy || existingState.maxCostMicros !== policy.maxCostMicros) conflict();\n const profile = graphManifest(manifest) ? 2 : 1;\n const owner: Owner = {format:profile,manifest,policy,resources,clockFloor:now,commands:[]}; const state = this.checkedState(row,owner);\n if (state.status !== 'running' || state.spentMicros !== 0 || state.reservedMicros !== 0 || state.output !== null || Object.values(state.steps).some(step => step.status !== 'pending' || step.receipt !== null || step.approval !== null || step.candidateHash !== null || step.costReserved !== 0 || step.output !== null)) conflict();\n if (await tx.runHasJobs(row.scope,row.id)) conflict();\n const ownerRow: OwnerRow = {scope:row.scope,aggregate_id:row.id,profile,aggregate_version:row.version,definition_hash:hashes.definition,policy_hash:hashes.policy,resource_hash:hashes.resources,data:JSON.stringify(object(owner))};\n await tx.insertOwner(ownerRow);\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,state.input) : {};\n return {row,owner,ownerRow,state,jobs:[],clock:{value:now},events:[],waits,facts:{},targetFacts:new Map()};\n }\n private async submit(input: JsonObject, profile: 1 | 2): Promise<unknown> {\n const manifest = input['manifest'] as unknown as Manifest; const policy = input['policy'] as unknown as WorkflowPolicyManifest; const resources = input['resources'] as unknown as WorkflowResourcePlan;\n const hashes = this.hashEnrollment(manifest,policy,resources); const key = input['idempotencyKey'] as string;\n const id = digest('mayura:run-id:v1',{scope:hashes.scope,submissionKey:key}); jsonValue(input['input'],{maxBytes:policy.maxOutputBytes});\n const state = graphManifest(manifest) ? initialWorkflowGraphState(manifest,input['input']!,hashes.definition,hashes.policy,policy.maxCostMicros)\n : initialWorkflowState(manifest,input['input']!,hashes.definition,hashes.policy,policy.maxCostMicros);\n const waits = graphManifest(manifest) ? workflowGraphTargets(manifest,state.input) : {};\n // Resolve every edge before parent creation, using independent target-only transactions.\n // No API may attach or mutate graph edges later, so every edge points to an earlier run.\n for (const targets of Object.values(waits)) for (const target of targets) {\n if (target.runId === id || target.policyHash !== hashes.policy) conflict();\n await this.materializeCompletion(hashes.scope,target);\n }\n return this.persistence.transaction(async tx => {\n await tx.lockRunIdentity(hashes.scope,id); await tx.aggregate(hashes.scope,id,false);\n const now = await storageClock(tx);\n const created = await tx.createAggregate(createCommand({scope:hashes.scope,id,idempotencyKey:key,definitionHash:hashes.definition,state:jsonValue(state) as JsonObject,events:[{type:'run.created',data:{}}]}),now);\n if (!created.created) {\n const run = await this.load(tx,hashes.scope,id,hashes.policy,false,profile); if (!run || run.ownerRow.resource_hash !== hashes.resources) conflict();\n return {snapshot:this.snapshot(run),created:false};\n }\n const run = await this.enroll(tx,created.row,input,now);\n for (const [nodeId,targets] of Object.entries(waits)) {\n for (const [ordinal,target] of targets.entries()) {\n await this.checkTargetIdentity(tx,hashes.scope,id,hashes.policy,target);\n await tx.insertWaitTarget({scope:hashes.scope,aggregate_id:id,node_id:nodeId,ordinal,run_id:target.runId,definition_hash:target.definitionHash,policy_hash:target.policyHash});\n }\n run.events.push({type:'workflow.wait_registered',data:{nodeId}});\n }\n if (profile === 2 && !this.admitsOutput(run,null)) throw new StorageError('LIMIT_EXCEEDED','Workflow graph cannot retain its bounded future control evidence.');\n await this.save(tx,run,undefined,undefined,{type:'workflow.enrolled',data:{profile:profile === 1 ? 'scheduled-v1' : 'scheduled-v2'}});\n return {snapshot:this.snapshot(run),created:true};\n });\n }\n async execute(method: ScheduledMethod,value: unknown,profile: 1 | 2 = 1): Promise<unknown> {\n const input = scheduledCommand(method,value,profile);\n if (method === 'initialize') return this.initialize();\n if (!this.initialized) throw new StorageError('STORE_NOT_INITIALIZED','Initialize scheduled workflow storage before use.');\n if (method === 'submit') return this.submit(input,profile);\n if (method === 'claim') return this.claim(input,profile);\n const result = await this.persistence.transaction(async tx => {\n const scope = input['scope'] as string; const id = input['id'] as string; const policyHash = input['policyHash'] as string;\n let run: LockedRun;\n if (method === 'attach') {\n await tx.lockRunIdentity(scope,id); const row = await tx.aggregate(scope,id,false);\n if (!row) throw new StorageError('NOT_FOUND','Workflow was not found in this scope.');\n const exists = await tx.ownedRun(scope,id);\n if (exists) { const previous = await this.load(tx,scope,id,policyHash,false,profile); if (!previous || !this.retry(previous,method,input)) conflict(); return this.snapshot(previous); }\n if (storedInteger(row.version) !== input['expectedVersion']) conflict();\n const hashes = this.hashEnrollment(input['manifest'] as unknown as WorkflowManifest,input['policy'] as unknown as WorkflowPolicyManifest,input['resources'] as unknown as WorkflowResourcePlan);\n if (hashes.policy !== policyHash) conflict();\n run = await this.enroll(tx,row,input,await storageClock(tx));\n await this.save(tx,run,method,input,{type:'workflow.enrolled',data:{profile:'scheduled-v1'}}); return this.snapshot(run);\n }\n run = (await this.load(tx,scope,id,policyHash,false,profile))!;\n const originalState = JSON.stringify(run.state);\n if (method === 'inspect') return this.snapshot(run);\n if (this.retry(run,method,input)) return method === 'start' ? {status:'already_started',snapshot:this.snapshot(run)} : this.snapshot(run);\n if (input['expectedVersion'] !== undefined && input['expectedVersion'] !== storedInteger(run.row.version)) conflict();\n if (method === 'recordReceipt') {\n const job = this.job(run,input); const node = this.node(run,job.nodeId); const prior = await this.accounting(tx,run,job,node);\n const result = await this.local(tx,run).execute('recordReceipt',{scope,jobId:job.jobId,fence:input['fence'],evidenceId:input['evidenceId'],receipt:input['receipt'],\n ...(input['settlement'] === undefined ? {} : {settlement:input['settlement']}),\n ...(input['source'] === undefined ? {} : {source:input['source']})}) as {disposition:EvidenceDisposition;job:JobRecord};\n if (run.events.length === 0) return this.snapshot(run);\n this.replaceJob(run,result.job); const step = run.state.steps[job.nodeId]!; const receipt = input['receipt'] as unknown as ExecutionReceipt;\n if (result.disposition !== 'conflicting') {\n step.receipt = mergeWorkflowReceipt(step.receipt,receipt);\n const projected = await this.accounting(tx,run,result.job,node); if (!projected) failed();\n const priorKnown = prior?.settlement.knownCostMicros ?? 0;\n if (projected.settlement.knownCostMicros < priorKnown) failed();\n run.state.spentMicros = nextCounter(run.state.spentMicros,projected.settlement.knownCostMicros-priorKnown);\n run.state.reservedMicros -= step.costReserved; step.costReserved = projected.settlement.unknownCostMicros;\n run.state.reservedMicros = nextCounter(run.state.reservedMicros,step.costReserved);\n }\n this.mirrorJob(run,result.job); await this.save(tx,run); return this.snapshot(run);\n }\n if (method === 'requestApproval' || method === 'approve' || method === 'prepare' || method === 'failNode') {\n const node = this.node(run,input['nodeId'] as string); const previous = run.state.steps[node.id]!;\n const expired = node.approval && previous.approval !== null && previous.approval.expiresAt <= run.clock.value;\n if (expired && method !== 'failNode' && (method !== 'requestApproval' || run.jobs.some(job => job.nodeId === node.id))) {\n await this.observeReviewExpiry(tx,run,node.id); return REVIEW_EXPIRED;\n }\n const step = this.unprepared(run,node,method === 'approve');\n if (method === 'requestApproval') {\n if (!node.approval || !this.authorized(run,node)) conflict();\n if (step.approval && step.approval.expiresAt > run.clock.value && step.approval.digest === this.candidate(run,node,input['input']!,step.approval.expiresAt)) return this.snapshot(run);\n let expiresAt: number; let candidate: string;\n try { expiresAt = nextCounter(run.clock.value,run.owner.policy.approvalTtlMs); candidate = this.candidate(run,node,input['input']!,expiresAt); }\n catch (error) { if (!expired) throw error; await this.observeReviewExpiry(tx,run,node.id); return REVIEW_EXPIRED; }\n step.approval = {digest:candidate,expiresAt,humanId:null}; step.status = 'waiting'; run.state.status = 'waiting';\n } else if (method === 'approve') {\n if (!node.approval || step.status !== 'waiting' || !step.approval || step.approval.digest !== input['digest'] || step.approval.expiresAt <= run.clock.value) conflict();\n step.approval.humanId = input['humanId'] as string; step.status = 'approved'; if (run.state.status !== 'paused') run.state.status = 'running';\n } else if (method === 'failNode') { step.status = input['outcome'] as 'failed'|'blocked'; }\n else {\n if (!this.authorized(run,node)) conflict();\n const expiresAt = node.approval ? step.approval?.expiresAt ?? 0 : null; const candidate = this.candidate(run,node,input['input']!,expiresAt);\n if (node.approval && (step.status !== 'approved' || !step.approval?.humanId || step.approval.digest !== candidate || step.approval.expiresAt <= run.clock.value)) conflict();\n if (node.costMicros > run.state.maxCostMicros - run.state.spentMicros - run.state.reservedMicros) { step.status = 'blocked'; }\n else {\n const jobId = digest('mayura:workflow-job:v1',{scope,id,nodeId:node.id});\n const job = (await this.local(tx,run).execute('reserve',{scope,jobId,reservationKey:jobId,runId:id,nodeId:node.id,invocationId:`${id}/${step.callId}`,definitionHash:run.ownerRow.definition_hash,candidateHash:candidate,\n intent:{toolId:node.tool,callId:`${id}/${step.callId}`,policyHash},resourceKeys:run.owner.resources[node.id]!,delayMs:0}) as {job:JobRecord}).job;\n await tx.insertLink(scope,id,node.id,jobId);\n step.candidateHash = candidate; step.costReserved = node.costMicros; run.state.reservedMicros = nextCounter(run.state.reservedMicros,node.costMicros);\n this.replaceJob(run,job);\n }\n }\n await this.save(tx,run,method,input,{type:method === 'requestApproval' ? 'approval.requested' : method === 'approve' ? 'approval.resolved' : method === 'prepare' ? 'step.prepared' : 'step.failed',data:{nodeId:node.id}});\n return this.snapshot(run);\n }\n if (method === 'start' || method === 'renew' || method === 'complete' || method === 'abandon') {\n const job = this.job(run,input); const token = input['claim'] as unknown as Claim; const step = run.state.steps[job.nodeId]!; const node = this.node(run,job.nodeId);\n const admissionExpiresAt = node.approval ? step.approval?.expiresAt ?? 0 : undefined;\n if (method !== 'renew' && terminalRuns.has(run.state.status)) conflict();\n if (await this.blockExpiredReview(tx,run,job)) { await this.save(tx,run); return STALE; }\n try {\n if (method === 'renew') {\n const renewed = await this.local(tx,run,job.jobId,admissionExpiresAt).execute('renew',{claim:token,leaseMs:input['leaseMs']}) as Claim;\n await this.refreshJob(tx,run,job.jobId); await this.save(tx,run); return renewed;\n }\n if (method === 'start') {\n if (!this.authorized(run,node) || this.candidate(run,node,input['input']!,node.approval ? step.approval?.expiresAt ?? 0 : null) !== step.candidateHash) conflict();\n this.ready(run,node);\n if (node.approval && (step.status !== 'approved' && step.status !== 'dispatching' || !step.approval?.humanId || step.approval.expiresAt <= run.clock.value)) conflict();\n const started = await this.local(tx,run,job.jobId,admissionExpiresAt).execute('start',{claim:token,candidateHash:step.candidateHash}) as {status:'started'|'already_started';job:JobRecord};\n this.replaceJob(run,started.job);\n if (started.status === 'already_started') return {status:'already_started',snapshot:this.snapshot(run)};\n step.status = 'dispatching'; run.state.status = 'running'; await this.save(tx,run,method,input,{type:'step.dispatching',data:{nodeId:node.id}});\n return {status:'started',snapshot:this.snapshot(run)};\n }\n if (method === 'abandon') {\n // A live renewal validates the precise never-started token without manufacturing a start marker.\n if (job.startedAtMs !== null || job.state !== 'leased') conflict();\n await this.local(tx,run,job.jobId,admissionExpiresAt).execute('renew',{claim:token,leaseMs:1000});\n await this.cancelJob(tx,run,job,digest('mayura:scheduled-internal-command:v1',{operation:'abandon',commandId:input['commandId']})); step.status = input['outcome'] as 'failed'|'blocked';\n } else {\n if (step.status !== 'dispatching') conflict();\n const outputAllowed = input['outcome'] !== 'succeeded' || this.admitsOutput(run,input['output']!,node.id);\n const outcome = outputAllowed ? input['outcome'] as 'succeeded'|'failed'|'blocked' : 'blocked';\n const completed = await this.local(tx,run).execute('complete',{claim:token,commandId:input['commandId'],evidenceId:input['evidenceId'],outcome,output:outcome === 'succeeded' ? input['output'] : null}) as JobRecord;\n this.replaceJob(run,completed); step.receipt = completed.receipt; step.status = outcome; step.output = completed.output;\n if (!outputAllowed) run.events.push({type:'step.output_blocked',data:{nodeId:node.id,reason:'OUTPUT_LIMIT'}});\n if (step.costReserved > 0 && step.receipt && step.receipt.execution !== 'unknown') this.refund(run,step,step.receipt.execution !== 'not_started');\n }\n await this.save(tx,run,method,input,{type:'step.completed',data:{nodeId:node.id,outcome:step.status}}); return this.snapshot(run);\n } catch (error) {\n if (!(error instanceof StorageError) || error.storageCode !== 'STALE_CLAIM') throw error;\n await this.blockExpiredReview(tx,run,job);\n if (run.events.length > 0) { this.mirrorJob(run,await this.refreshJob(tx,run,job.jobId)); await this.save(tx,run); }\n return STALE;\n }\n }\n if (method === 'cancel') {\n if (!terminalRuns.has(run.state.status)) {\n run.state.status = 'cancelled'; run.state.output = null;\n for (const job of [...run.jobs]) await this.cancelJob(tx,run,job,digest('mayura:scheduled-internal-command:v1',{operation:'cancel',commandId:input['commandId']}));\n for (const [nodeId,step] of Object.entries(run.state.steps)) if (!run.jobs.some(job => job.nodeId === nodeId) && !terminalSteps.has(step.status)) step.status = 'skipped';\n }\n } else if (method === 'recover') {\n for (const job of [...run.jobs]) {\n if (await this.blockExpiredReview(tx,run,job)) continue;\n const recovered = await this.local(tx,run,job.jobId).execute('recover',{scope,limit:1}) as JobRecord[];\n for (const item of recovered) { this.replaceJob(run,item); this.mirrorJob(run,item); }\n }\n this.advance(run);\n } else if (method === 'pause') {\n if (run.state.status !== 'paused') {\n if (terminalRuns.has(run.state.status)) conflict();\n // Quiescence: a claimed or started job must settle, be released or be recovered first.\n if (run.jobs.some(job => job.state === 'leased' || job.state === 'started')) conflict();\n run.state.status = 'paused';\n }\n } else if (method === 'resume') {\n if (run.state.status !== 'paused') conflict();\n run.state.status = 'running'; this.advance(run);\n } else if (method === 'migrate') {\n await this.migrateRun(tx,run,input);\n await this.save(tx,run,method,input,{type:'run.migrated',data:{migrationId:input['migrationId']!,from:run.owner.lineage!.at(-1)!,to:run.ownerRow.definition_hash,actorId:input['actorId']!,commandId:input['commandId']!}});\n return this.snapshot(run);\n } else if (method === 'advance') this.advance(run);\n else if (method === 'finalize') {\n if (terminalRuns.has(run.state.status) || run.state.status === 'paused' || Object.values(run.state.steps).some(step => step.status !== 'succeeded') || run.state.reservedMicros !== 0) conflict();\n if (input['validation'] === 'passed' && this.admitsOutput(run,input['output']!)) { run.state.output = input['output']!; run.state.status = 'succeeded'; }\n else { run.state.output = null; run.state.status = 'failed'; }\n } else conflict();\n // A no-op is not a committed transition, so it consumes neither a version nor a command journal entry.\n if (run.events.length === 0 && JSON.stringify(run.state) === originalState) return this.snapshot(run);\n const transition = method === 'cancel' ? 'run.cancelled' : method === 'finalize' ? 'run.completed'\n : method === 'pause' ? 'run.paused' : method === 'resume' ? 'run.resumed' : 'workflow.advanced';\n await this.save(tx,run,method,input,{type:transition,data:{status:run.state.status}});\n return this.snapshot(run);\n });\n if (result === STALE) throw new StorageError('STALE_CLAIM','Scheduled ownership expired or no longer permits the transition.');\n // Keep this text in sync with reviewExpiredMessage in @mayura/workflows: the driver recognizes it.\n if (result === REVIEW_EXPIRED) throw new StorageError('CONFLICT','The approval expired; request a new review before admission.');\n return result;\n }\n private async claim(input: JsonObject, profile: 1 | 2): Promise<unknown> {\n const scope = input['scope'] as string; const id = input['id'] as string; const policy = input['policyHash'] as string;\n const hints = await this.persistence.transaction(async tx => { const run = await this.load(tx,scope,id,policy,false,profile); return run?.jobs.filter(job => job.state === 'ready').map(job => job.jobId) ?? []; });\n const results: {job:JobRecord;claim:Claim}[] = [];\n for (const jobId of hints) {\n if (results.length >= (input['limit'] as number)) break;\n try {\n const result = await this.persistence.transaction(async tx => {\n // This is an explicit run request, not a global queue scan: skipping its busy aggregate\n // can make every cooperating worker return while eligible work is still ready.\n const run = await this.load(tx,scope,id,policy,false,profile); if (!run || terminalRuns.has(run.state.status) || run.state.status === 'paused') return undefined;\n const job = run.jobs.find(job => job.jobId === jobId); if (!job || job.state !== 'ready') return undefined;\n if (await this.blockExpiredReview(tx,run,job)) { await this.save(tx,run); return undefined; }\n const claims = await this.local(tx,run,jobId).execute('claim',{scope,workerId:input['workerId'],limit:1,leaseMs:input['leaseMs']}) as {job:JobRecord;claim:Claim}[];\n if (!claims[0]) return undefined; this.replaceJob(run,claims[0].job);\n // Resource acquisition can wait; recheck review expiry using the scheduler's post-lock clock.\n if (await this.blockExpiredReview(tx,run,claims[0].job)) { await this.save(tx,run); return undefined; }\n await this.save(tx,run); return claims[0];\n });\n if (result) results.push(result);\n } catch (error) { if (!(error instanceof ResourceBusy)) throw error; }\n }\n return results;\n }\n}\n"]}