akm-cli 0.9.30 → 0.10.261001-beta

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 (384) hide show
  1. package/CHANGELOG.md +438 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/STABILITY.md +99 -57
  5. package/dist/api-node.mjs +20 -0
  6. package/dist/api.d.ts +23 -0
  7. package/dist/api.js +45 -0
  8. package/dist/assets/hints/cli-hints-full.md +15 -29
  9. package/dist/assets/hints/cli-hints-short.md +2 -2
  10. package/dist/assets/improve-strategies/default.json +3 -3
  11. package/dist/assets/prompts/consolidate-pair.md +9 -7
  12. package/dist/assets/stash-skeleton/README.md +1 -1
  13. package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
  14. package/dist/cli/shared.js +31 -48
  15. package/dist/cli/unknown-flags.js +6 -43
  16. package/dist/cli.js +8 -34
  17. package/dist/commands/agent/contribute-cli.js +1 -1
  18. package/dist/commands/completions.js +1 -2
  19. package/dist/commands/config-cli.js +5 -28
  20. package/dist/commands/env/env-cli.js +5 -5
  21. package/dist/commands/env/secret-cli.js +2 -2
  22. package/dist/commands/feedback-cli.js +75 -49
  23. package/dist/commands/health/checks.js +41 -16
  24. package/dist/commands/health/plugin-staleness.js +52 -22
  25. package/dist/commands/improve/autonomy-gate.js +5 -3
  26. package/dist/commands/improve/consolidate/chunking.js +3 -10
  27. package/dist/commands/improve/consolidate/continuity-check.js +4 -4
  28. package/dist/commands/improve/consolidate/pair-pass.js +29 -10
  29. package/dist/commands/improve/consolidate.js +10 -65
  30. package/dist/commands/improve/distill/lesson-update.js +91 -0
  31. package/dist/commands/improve/distill-guards.js +1 -43
  32. package/dist/commands/improve/distill.js +148 -21
  33. package/dist/commands/improve/eligibility.js +14 -1
  34. package/dist/commands/improve/extract-cli.js +1 -1
  35. package/dist/commands/improve/extract-prompt.js +17 -7
  36. package/dist/commands/improve/extract.js +5 -7
  37. package/dist/commands/improve/improve-cli.js +125 -118
  38. package/dist/commands/improve/improve-strategies.js +8 -12
  39. package/dist/commands/improve/improve.js +134 -52
  40. package/dist/commands/improve/loop-stages.js +18 -5
  41. package/dist/commands/improve/planner.js +0 -1
  42. package/dist/commands/improve/preparation.js +40 -99
  43. package/dist/commands/improve/proactive-maintenance.js +2 -2
  44. package/dist/commands/improve/reflect-noise.js +3 -55
  45. package/dist/commands/improve/reflect.js +29 -34
  46. package/dist/commands/improve/retrieval-queries.js +37 -0
  47. package/dist/commands/improve/retrieval-scope.js +2 -2
  48. package/dist/commands/improve/salience.js +2 -9
  49. package/dist/commands/improve/session-asset.js +4 -1
  50. package/dist/commands/improve/stage.js +23 -12
  51. package/dist/commands/lint/index.js +5 -20
  52. package/dist/commands/observability-cli.js +3 -9
  53. package/dist/commands/proposal/drain.js +43 -6
  54. package/dist/commands/proposal/proposal-cli.js +11 -31
  55. package/dist/commands/proposal/repository.js +20 -14
  56. package/dist/commands/proposal/validators/proposal-quality-validators.js +0 -3
  57. package/dist/commands/read/knowledge.js +3 -3
  58. package/dist/commands/read/remember-cli.js +0 -13
  59. package/dist/commands/read/search-cli.js +29 -97
  60. package/dist/commands/read/search.js +0 -11
  61. package/dist/commands/read/show.js +0 -19
  62. package/dist/commands/sources/plugin-upgrade.js +164 -101
  63. package/dist/commands/sources/sources-cli.js +1 -15
  64. package/dist/commands/sources/stash-cli.js +6 -14
  65. package/dist/commands/tasks/tasks-cli.js +4 -115
  66. package/dist/commands/workflow/plan.js +11 -33
  67. package/dist/commands/workflow-cli.js +2 -7
  68. package/dist/core/adapter/adapter-ids.js +1 -2
  69. package/dist/core/adapter/adapters/agent-skills-adapter.js +0 -4
  70. package/dist/core/adapter/adapters/akm-adapter.js +9 -48
  71. package/dist/core/adapter/adapters/akm-lint.js +10 -26
  72. package/dist/core/adapter/adapters/akm-metadata.js +2 -72
  73. package/dist/core/adapter/adapters/akm-task-adapter.js +0 -5
  74. package/dist/core/adapter/adapters/akm-workflow-adapter.js +9 -28
  75. package/dist/core/adapter/adapters/dotenv-adapter.js +1 -20
  76. package/dist/core/adapter/adapters/generic-files-adapter.js +0 -10
  77. package/dist/core/adapter/adapters/llm-wiki-adapter.js +0 -4
  78. package/dist/core/adapter/adapters/tool-dir-shared.js +0 -24
  79. package/dist/core/adapter/adapters/website-snapshot-adapter.js +4 -4
  80. package/dist/core/adapter/recognize-match.js +3 -4
  81. package/dist/core/common.js +18 -2
  82. package/dist/core/config/config-schema.js +12 -15
  83. package/dist/core/config/config-types.js +6 -15
  84. package/dist/core/config/config-walker.js +6 -23
  85. package/dist/core/config/config.js +17 -80
  86. package/dist/core/config/engine-semantics.js +7 -3
  87. package/dist/core/config/schema/engines.js +7 -7
  88. package/dist/core/config/schema/improve-processes.js +10 -63
  89. package/dist/core/config/schema/improve.js +2 -21
  90. package/dist/core/config/schema/index-config.js +6 -39
  91. package/dist/core/env-secret-ref.js +2 -45
  92. package/dist/core/errors.js +1 -2
  93. package/dist/core/extra-params.js +2 -86
  94. package/dist/core/file-lock.js +12 -7
  95. package/dist/core/improve-result.js +13 -1
  96. package/dist/core/mutation-target.js +2 -2
  97. package/dist/core/paths.js +4 -0
  98. package/dist/core/recognition-util.js +4 -5
  99. package/dist/core/run-lock.js +1 -1
  100. package/dist/core/subprocess.js +49 -0
  101. package/dist/core/warn.js +21 -4
  102. package/dist/core/write-source.js +3 -3
  103. package/dist/execution/target-ref.js +1 -2
  104. package/dist/indexer/indexer.js +15 -6
  105. package/dist/indexer/passes/memory-inference.js +15 -6
  106. package/dist/indexer/search/db-search.js +49 -36
  107. package/dist/indexer/search/fts-query.js +0 -19
  108. package/dist/indexer/search/ranking.js +29 -1
  109. package/dist/indexer/usage/usage-events.js +21 -16
  110. package/dist/integrations/agent/engine-resolution.js +5 -2
  111. package/dist/integrations/agent/index.js +1 -1
  112. package/dist/integrations/agent/profiles.js +41 -98
  113. package/dist/integrations/agent/request-lowering.js +3 -3
  114. package/dist/integrations/harnesses/aider/index.js +5 -0
  115. package/dist/integrations/harnesses/amazonq/index.js +1 -0
  116. package/dist/integrations/harnesses/claude/config-import.js +2 -3
  117. package/dist/integrations/harnesses/claude/index.js +5 -0
  118. package/dist/integrations/harnesses/codex/index.js +1 -0
  119. package/dist/integrations/harnesses/copilot/index.js +1 -0
  120. package/dist/integrations/harnesses/gemini/index.js +1 -0
  121. package/dist/integrations/harnesses/index.js +18 -39
  122. package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
  123. package/dist/integrations/harnesses/opencode/config-import.js +121 -52
  124. package/dist/integrations/harnesses/opencode/index.js +22 -0
  125. package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
  126. package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
  127. package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
  128. package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
  129. package/dist/integrations/harnesses/opencode/session-log.js +104 -115
  130. package/dist/integrations/harnesses/opencode/version.js +98 -0
  131. package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
  132. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
  133. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
  134. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +254 -0
  135. package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
  136. package/dist/integrations/harnesses/openhands/index.js +1 -0
  137. package/dist/integrations/harnesses/pi/index.js +1 -0
  138. package/dist/integrations/harnesses/shared.js +2 -0
  139. package/dist/integrations/harnesses/types.js +2 -0
  140. package/dist/llm/client.js +74 -14
  141. package/dist/output/cli-hints.js +1 -1
  142. package/dist/output/context.js +10 -19
  143. package/dist/output/format-exempt.js +5 -8
  144. package/dist/output/shapes/helpers.js +1 -22
  145. package/dist/output/shapes/passthrough.js +0 -1
  146. package/dist/output/shapes.js +3 -31
  147. package/dist/output/stdout.js +5 -1
  148. package/dist/output/text/command-format.js +6 -1
  149. package/dist/output/text/workflow-format.js +4 -22
  150. package/dist/scripts/akm-migrate-node.js +15769 -16731
  151. package/dist/scripts/akm-migrate.js +16339 -17297
  152. package/dist/setup/detect.js +10 -4
  153. package/dist/setup/harness-config-import.js +5 -14
  154. package/dist/setup/setup.js +1 -1
  155. package/dist/setup/steps/tasks.js +12 -13
  156. package/dist/sources/providers/git-stash.js +94 -13
  157. package/dist/storage/repositories/index-utility-repository.js +2 -32
  158. package/dist/storage/repositories/index-vec-repository.js +4 -0
  159. package/dist/storage/repositories/task-history-repository.js +0 -5
  160. package/dist/storage/repositories/workflow-runs-repository.js +5 -15
  161. package/dist/tasks/embedded.js +2 -1
  162. package/dist/tasks/run/run-command-task.js +9 -1
  163. package/dist/tasks/run/run-workflow-task.js +4 -3
  164. package/dist/tasks/run/task-history.js +0 -2
  165. package/dist/tasks/run/task-log.js +38 -1
  166. package/dist/tasks/schedule-gates.js +39 -0
  167. package/dist/tasks/scheduler-binding.js +0 -16
  168. package/dist/tasks/scheduler-sync.js +3 -97
  169. package/dist/tasks/source/bounded-document.js +1 -1
  170. package/dist/tasks/source/task-source-v4.js +2 -12
  171. package/dist/tasks/task-run-reserved-flags.js +2 -31
  172. package/dist/workflows/authoring/authoring.js +6 -6
  173. package/dist/workflows/compile.js +8 -65
  174. package/dist/workflows/exec/child-workflow.js +22 -3
  175. package/dist/workflows/exec/native-executor.js +12 -147
  176. package/dist/workflows/exec/run-workflow.js +31 -103
  177. package/dist/workflows/exec/step-work.js +9 -178
  178. package/dist/workflows/exec/unit-dispatch.js +0 -10
  179. package/dist/workflows/freeze/environment.js +3 -44
  180. package/dist/workflows/freeze/freeze.js +8 -41
  181. package/dist/workflows/freeze/targets/child-workflow.js +27 -63
  182. package/dist/workflows/freeze/targets/command.js +2 -16
  183. package/dist/workflows/freeze/targets/shell.js +0 -2
  184. package/dist/workflows/freeze/task-bindings.js +2 -28
  185. package/dist/workflows/ir/params.js +12 -2
  186. package/dist/workflows/parser.js +82 -232
  187. package/dist/workflows/plan.js +1 -1
  188. package/dist/workflows/renderer.js +10 -19
  189. package/dist/workflows/runtime/run-plan.js +11 -53
  190. package/dist/workflows/runtime/runs.js +4 -27
  191. package/dist/workflows/source-files.js +12 -16
  192. package/dist/workflows/source-semantics.js +1 -93
  193. package/docs/README.md +43 -42
  194. package/docs/agents/README.md +15 -0
  195. package/docs/agents/agent-install.md +14 -0
  196. package/docs/architecture/0.10-process-rules.md +827 -0
  197. package/docs/architecture/README.md +67 -0
  198. package/docs/architecture/adapters.md +258 -0
  199. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  200. package/docs/architecture/akm-core-principles.md +126 -0
  201. package/docs/architecture/architecture.md +578 -0
  202. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  203. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  204. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  205. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  206. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  207. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  208. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  209. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  210. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  211. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  212. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  213. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  214. package/docs/architecture/decisions/README.md +62 -0
  215. package/docs/architecture/improvement.md +479 -0
  216. package/docs/architecture/internals/classification.md +154 -0
  217. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  218. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  219. package/docs/architecture/internals/health-advisories.md +110 -0
  220. package/docs/architecture/internals/improve-workflow.md +719 -0
  221. package/docs/architecture/internals/indexing.md +498 -0
  222. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  223. package/docs/architecture/internals/search.md +248 -0
  224. package/docs/architecture/internals/storage-locations.md +943 -0
  225. package/docs/architecture/persisted-data-compat.md +68 -0
  226. package/docs/architecture/reviews/env-secret-access.md +319 -0
  227. package/docs/architecture/runtime-boundary-design.md +153 -0
  228. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  229. package/docs/architecture/specs/0.9.0-decisions.md +532 -0
  230. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  231. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  232. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  233. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  234. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  235. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  236. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  237. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  238. package/docs/architecture/specs/di-seams-plan.md +539 -0
  239. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  240. package/docs/architecture/specs/fact-asset-type.md +142 -0
  241. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  242. package/docs/architecture/specs/okf-support.md +148 -0
  243. package/docs/architecture/specs/ref.md +329 -0
  244. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  245. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  246. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  247. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  248. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  249. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  250. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  251. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  252. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  253. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  254. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  255. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  256. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  257. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  258. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  259. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  260. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  261. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  262. package/docs/architecture/specs/workflow-format-unification.md +432 -0
  263. package/docs/architecture/testing/manual-testing-checklist.md +3411 -0
  264. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  265. package/docs/architecture/testing/task-workflow-manual-tests.md +1720 -0
  266. package/docs/architecture/testing/testing-workflow.md +446 -0
  267. package/docs/architecture/workflow-engine.md +223 -0
  268. package/docs/guides/README.md +33 -0
  269. package/docs/guides/author-bundles.md +310 -0
  270. package/docs/guides/author-workflows.md +490 -0
  271. package/docs/guides/bundles.md +323 -0
  272. package/docs/guides/capture-knowledge.md +136 -0
  273. package/docs/guides/claude-code-vs-akm-workflows.md +29 -0
  274. package/docs/guides/concepts.md +93 -0
  275. package/docs/guides/discover-and-load.md +158 -0
  276. package/docs/guides/getting-started.md +240 -0
  277. package/docs/guides/improve-the-library.md +247 -0
  278. package/docs/guides/knowledge-management.md +18 -0
  279. package/docs/guides/recipes/headless-install.md +97 -0
  280. package/docs/guides/recipes/website-source.md +28 -0
  281. package/docs/guides/run-workflows.md +279 -0
  282. package/docs/guides/scheduling.md +131 -0
  283. package/docs/guides/use-with-any-agent.md +174 -0
  284. package/docs/guides/wikis.md +81 -0
  285. package/docs/integration/bundling-akm.md +7 -6
  286. package/docs/maintainers/README.md +19 -0
  287. package/docs/maintainers/curate-workmap.md +335 -0
  288. package/docs/maintainers/eval.md +3 -0
  289. package/docs/maintainers/local-development.md +108 -0
  290. package/docs/maintainers/release-checklist.md +135 -0
  291. package/docs/migration/README.md +4 -2
  292. package/docs/migration/release-notes/0.0.13.md +1 -1
  293. package/docs/migration/release-notes/0.1.0.md +1 -1
  294. package/docs/migration/release-notes/0.10.0.md +201 -0
  295. package/docs/migration/release-notes/0.2.0.md +1 -1
  296. package/docs/migration/release-notes/0.3.0.md +1 -1
  297. package/docs/migration/release-notes/0.5.0.md +1 -1
  298. package/docs/migration/release-notes/0.6.0.md +1 -1
  299. package/docs/migration/release-notes/0.7.0.md +1 -1
  300. package/docs/migration/release-notes/0.7.3.md +2 -2
  301. package/docs/migration/release-notes/0.7.4.md +1 -1
  302. package/docs/migration/release-notes/0.7.5.md +1 -1
  303. package/docs/migration/release-notes/0.8.0.md +1 -1
  304. package/docs/migration/release-notes/0.9.0.md +1 -1
  305. package/docs/migration/release-notes/0.9.14.md +1 -1
  306. package/docs/migration/release-notes/0.9.15.md +1 -1
  307. package/docs/migration/release-notes/0.9.16.md +1 -1
  308. package/docs/migration/release-notes/0.9.17.md +1 -1
  309. package/docs/migration/release-notes/0.9.19.md +1 -1
  310. package/docs/migration/release-notes/0.9.2.md +1 -1
  311. package/docs/migration/release-notes/README.md +28 -31
  312. package/docs/migration/v0.5-to-v0.6.md +759 -0
  313. package/docs/migration/v0.8-to-v0.9.md +1 -1
  314. package/docs/migration/v0.9-to-v0.10.md +507 -0
  315. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  316. package/docs/posts/README.md +30 -0
  317. package/docs/posts/akm-command-tour.md +495 -0
  318. package/docs/posts/akm-logo-sized.webp +0 -0
  319. package/docs/posts/belief-aware-memory-12.md +139 -0
  320. package/docs/posts/config-v2-lessons-16.md +191 -0
  321. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  322. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  323. package/docs/posts/intro-part-01.md +76 -0
  324. package/docs/posts/intro-part-02.md +221 -0
  325. package/docs/posts/intro-part-03.md +190 -0
  326. package/docs/posts/intro-part-04.md +221 -0
  327. package/docs/posts/llm-mode-reflect-13.md +166 -0
  328. package/docs/posts/openpalm-built-on-akm.md +86 -0
  329. package/docs/posts/progressive-disclosure-06.md +129 -0
  330. package/docs/posts/proposal-safety-net-15.md +112 -0
  331. package/docs/posts/release-0.5.0.md +247 -0
  332. package/docs/posts/release-0.6.0.md +117 -0
  333. package/docs/posts/release-0.7.0.md +159 -0
  334. package/docs/posts/release-0.8.0.md +332 -0
  335. package/docs/posts/scattered-skills-05.md +100 -0
  336. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  337. package/docs/posts/team-skills-07.md +198 -0
  338. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  339. package/docs/posts/workflows-vaults-09.md +321 -0
  340. package/docs/product-surface.md +54 -0
  341. package/docs/reference/README.md +2 -2
  342. package/docs/reference/api.md +65 -0
  343. package/docs/reference/asset-types.md +166 -0
  344. package/docs/reference/bundle-types.md +2 -4
  345. package/docs/reference/cli.md +163 -192
  346. package/docs/reference/configuration.md +101 -20
  347. package/docs/reference/data-and-telemetry.md +2 -2
  348. package/docs/reference/env-and-secrets.md +126 -0
  349. package/docs/reference/memory.md +124 -0
  350. package/docs/reference/refs.md +156 -0
  351. package/docs/reference/registry.md +489 -0
  352. package/docs/reference/supported-formats.md +3 -4
  353. package/docs/reference/tasks.md +12 -19
  354. package/docs/reference/website-sources.md +141 -0
  355. package/docs/reference/workflow-schema.md +89 -317
  356. package/docs/reference/workflows.md +20 -48
  357. package/package.json +23 -16
  358. package/schemas/akm-config.json +2 -243
  359. package/schemas/akm-task.json +2 -3
  360. package/schemas/akm-workflow.json +47 -84
  361. package/dist/assets/improve-strategies/catchup.json +0 -41
  362. package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
  363. package/dist/assets/improve-strategies/quick.json +0 -17
  364. package/dist/assets/improve-strategies/reflect-distill.json +0 -29
  365. package/dist/assets/improve-strategies/thorough.json +0 -49
  366. package/dist/assets/prompts/retrieval-relevance-judge.md +0 -6
  367. package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
  368. package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
  369. package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
  370. package/dist/cli/retired-commands.js +0 -118
  371. package/dist/commands/improve/retrieval-gate.js +0 -132
  372. package/dist/commands/tasks/validate.js +0 -176
  373. package/dist/core/config/legacy-source-shape-shim.js +0 -117
  374. package/dist/indexer/feedback/utility-policy.js +0 -75
  375. package/dist/integrations/harnesses/ids.js +0 -28
  376. package/dist/tasks/source/task-source-v3-frozen.js +0 -424
  377. package/dist/tasks/source/task-to-v4.js +0 -863
  378. package/dist/workflows/exec/worktree.js +0 -372
  379. package/dist/workflows/freeze/child-output-references.js +0 -83
  380. package/dist/workflows/freeze/identity.js +0 -22
  381. package/dist/workflows/freeze/targets/script.js +0 -50
  382. package/dist/workflows/freeze/targets/task.js +0 -124
  383. package/dist/workflows/github-yaml.js +0 -506
  384. package/dist/workflows/runtime/run-outputs.js +0 -80
@@ -0,0 +1,152 @@
1
+ # Consolidated findings — three independent Opus reviews of spec v7 + codebase
2
+
3
+ Sources: review-1.md (758 lines), review-2.md (645), review-3.md (602).
4
+ "R1/R2/R3" = which reviewers found it independently. 3/3 = unanimous.
5
+
6
+ ## Critical (all confirmed by ≥2 reviewers)
7
+
8
+ C1. 3/3 — **`output:` is NOT a duplicate; the flatten collides two different schemas.**
9
+ `unit.output` = per-dispatch structured-result schema (LLM responseSchema, structured
10
+ retry, driver --result-file); `step.output` = promoted artifact / reducer result feeding
11
+ the gate loop. Deleting the bag merges them and makes per-item schemas on map steps
12
+ unexpressible. (compile.ts:204,229; step-work.ts:555-561; native-executor.ts:663,928,1092)
13
+
14
+ C2. 3/3 — **`run:` shell units are unrepresentable in IR v3 / the dispatch seam.**
15
+ UnitDispatchRequest.engine and IrInvocation.engine are required; FrozenEngineSnapshot is
16
+ a closed 2-kind union; freeze hard-errors with no engine; IR rejects empty instructions;
17
+ no shell runner exists; brief/report behavior undefined. §10's "no IR/freeze changes" is
18
+ false. (unit-dispatch.ts:15-19; ir/schema.ts:29-85,434-441,481-497; freeze.ts:49-75)
19
+
20
+ C3. 3/3 — **The unit input-hash preimage is unaddressed → silent replay-reuse bugs.**
21
+ hashVersion 4 hashes template instructions/item/inputs/params/dispatch/env NAMES only.
22
+ run: text, uses: refs, cwd, shell, appended prose, and env literal values are all
23
+ outside the preimage; editing any of them would reuse completed journal rows. The
24
+ prose-append also can't happen "at one seam" — prompts are assembled per-unit at
25
+ dispatch (item/inputs/gate blocks), so the append must be a freeze-time concat plus a
26
+ hash-version bump. (step-work.ts:333-393,473-500)
27
+
28
+ C4. 3/3 — **The cascade's far layers don't exist; the worked example is a no-op today.**
29
+ DefaultsSchema has no `model` (passthrough swallows it silently); `defaults.llm` is
30
+ explicitly hard-rejected as retired; freeze's layer list is only [documentDefaults,
31
+ unit]; there is no persona layer. The spec presents "exposing an existing mechanism";
32
+ reality is a 2-layer mechanism that must be extended to 5.
33
+ (config-schema.ts:102-108,234-241; freeze.ts:50,163-209)
34
+
35
+ C5. 2/3 — **`uses: scripts/*` reverses a documented security boundary.**
36
+ Script run/setup/cwd frontmatter is advisory/display-only today; "registering a bundle
37
+ never activates code" is an explicit invariant; executing a third-party bundle's script
38
+ at cron time is net-new RCE surface with no activation-policy rule.
39
+ (indexer/passes/metadata.ts:140-144; renderers.ts:118-142; core/activation-policy.ts)
40
+
41
+ ## Major
42
+
43
+ M1. 3/3 — **`params` acquires 3-4 conflicting meanings** (frontmatter schema declarations,
44
+ workflow run-args, command placeholder fills, cascade value field) — the same
45
+ indictment the spec levels at `prompt:`. Cascaded params also violate the params-are-
46
+ non-secret/un-redactable contract and inject undeclared names the flag validators
47
+ reject. (ir/params.ts:34-72; param-secrets.ts:9-19; akm-workflow.json:22-32)
48
+
49
+ M2. 3/3 — **Command-template filling contradicts the real placeholder contract.**
50
+ Placeholders are $ARGUMENTS/$1-$9 positional (+ {{name}} advertised, but
51
+ fillPlaceholders only substitutes positional {{0}} leniently — a live bug); named
52
+ `params:` has no projection onto positionals; the proposed fill-time hard error makes
53
+ every $ARGUMENTS command unusable as a target. (renderers.ts:164-186;
54
+ matchers.ts:126; agent-dispatch.ts:63-72)
55
+
56
+ M3. 3/3 — **`env:` list shape is NOT additive.** IR types env as string[]; the input hash
57
+ deliberately carries env NAMES ONLY (values never durable); literal values would be
58
+ frozen into plan_json, hashed, and surfaced by brief; every resolved value joins
59
+ sensitiveValues with no floor, so `LOG_LEVEL: debug` over-redacts "debug" everywhere;
60
+ AKM_ITEM fan-out needs per-unit env (env resolves once per step today).
61
+ (ir/compile.ts:46; step-work.ts:353-357,387; native-executor.ts:449-457,1163-1193)
62
+
63
+ M4. 3/3 — **Alias portability claim unimplemented.** BUILTIN_ALIASES has only
64
+ claude/opencode columns; `model: sonnet` passes through verbatim to LLM endpoints and
65
+ opencode-sdk. (model-aliases.ts:45-76,103-109)
66
+
67
+ M5. 2/3 — **`agent:` selector needs plumbing + a provenance decision.** systemPrompt and
68
+ toolPolicy cannot reach a workflow unit; the self-declared `tools:` policy is gated by
69
+ a writable-vs-third-party provenance ceiling applied at the show layer that freeze
70
+ knows nothing about. ALSO: the spec's corroboration "command assets already read an
71
+ agent: field" is FALSE — it's a type-classification signal; nothing consumes the value.
72
+ (native-executor.ts:1026-1035; renderers.ts:250-262; matchers.ts:234-236)
73
+
74
+ M6. 2/3 — **The kind-gated llm hard error §3.4 argues against is dead code in freeze** —
75
+ computed only when kind==="llm", then guarded kind!=="llm" && llm!==undefined
76
+ (unreachable); workflows silently DROP llm overrides on agent engines; the live error
77
+ exists only on the task path. (freeze.ts:67-73; runner.ts:497-502)
78
+
79
+ M7. 3/3 — **Migration section overclaims.** Not a byte-rewrite (existing migrator rewrites
80
+ scalars in place, journals byte diffs, refuses read-only bundles; .yml→.md renames
81
+ break that model); `name:` silently dropped; llm.supportsJsonSchema/contextLength/
82
+ enableThinking have no home in the nine value fields; command ARRAYS have no shell
83
+ spelling; "strays named by path" is not structural — refusals key on config/DB shape,
84
+ not leftover files, and placement/sync filter by extension, so a stray .yml is invisible
85
+ or wrongly installed; `<id>.yml` + `<id>.md` collide on one conceptId.
86
+ (task-target-ref-migration.ts:27,44-66; asset-placement.ts:159-170; tasks.ts:155-164,414)
87
+
88
+ M8. 2/3 — **Markdown-task recognition collides with the .md-claiming workflow adapter**
89
+ (ordered first; claims any .md without a different type:), so `type: task` is mandatory
90
+ and "tasks/ residence" recognition is unimplementable as written; contradicts
91
+ okf-support.md's current text; akm-task format-family goldens are marked immutable.
92
+ (adapters/index.ts:73-90; akm-workflow-adapter.ts:60-76)
93
+
94
+ M9. 2/3 — **`run:` shell text defeats akm-bin resolution.** resolveNestedAkmCommand
95
+ rewrites bare `akm` in pre-split argv to the current installation; all ten shipped
96
+ templates depend on it; shell text makes it impossible without sniffing.
97
+ (runner.ts:277-289,343-348; command-executable.ts:10-22)
98
+
99
+ M10. 2/3 — **Optional prose contradicts two live invariants** — the parser errors on a
100
+ missing/empty step section and the IR rejects empty instructions.
101
+ (workflows/parser.ts:281-296; ir/schema.ts:434-441)
102
+
103
+ M11. 1/3 — **uses: tasks/<id> makes freeze IO-dependent, and lint never freezes** — all
104
+ composition errors escape lint (freeze has exactly one caller: run start); cross-bundle
105
+ ref scoping undefined. (freeze.ts:39-43; runs.ts:241)
106
+
107
+ M12. 2/3 — **`defaults.on_error` already exists at document level** — "graph keys are
108
+ steps-only" silently deletes it; no §8 migration row. (program/schema.ts:210; compile.ts:231)
109
+
110
+ M13. 1/3 — **Markdown tasks inherit the lint/OKF/improve surface** — the akm adapter
111
+ special-cases type:"task" as pure YAML so markdown checks never fire; an
112
+ improve-eligible body is now the literal executable prompt of a scheduled agent.
113
+ (akm-adapter.ts:388-434)
114
+
115
+ ## Notable minors (deduped)
116
+
117
+ - `status: draft` overloads OKF lifecycle with scheduler activation — second gate beside
118
+ `enabled:`, no precedence, `deprecated` undefined. (2/3)
119
+ - `prompt: agents/x` today ships RAW file bytes incl. frontmatter to the model — live bug,
120
+ worse than §3.5 states. (2/3)
121
+ - §3.5 embodiment sentence reads backwards (--model wins over hint). (1/3)
122
+ - Engine nodes are .passthrough() with blacklists — "strict schema" claim overstated;
123
+ cwd/shell/env/params would be silently accepted. (2/3)
124
+ - Trigger-keys claim inaccurate: the runner also gates `enabled` at fire time. (1/3)
125
+ - Value fields on `uses: workflows/*` tasks are structurally inert (run-workflow takes
126
+ ref+params only). (1/3)
127
+ - Subdir task ids: placement indexes `sub/x` but validateTaskId rejects `/` — inherited
128
+ bug; `.yml` hardcoded in id length budget. (1/3)
129
+ - Embedded templates: enumeration filters .yml, drops non-command targets; setup's YAML
130
+ round-trip would destroy markdown bodies. (2/3)
131
+ - Model aliases: gate judgeEngine sits outside the cascade. (1/3)
132
+ - Composition can breach the 256 KiB instruction cap; single-file provenance lost. (1/3)
133
+ - task_history.target_kind is a persisted 3-value enum the vocabulary outgrows. (1/3)
134
+ - cwd × isolation:worktree × llm-runner interaction unspecified. (1/3)
135
+ - uses: table covers 5 of ~15 placement types; no rule for the rest. (1/3)
136
+
137
+ ## Verified accurate (all three ran verification passes)
138
+
139
+ The §2 freeze-cascade description, the UnitDispatchRequest field inventory, the
140
+ resolveModel 4-tier chain, engines.ts kind-split (as blacklists), the 368-line parser and
141
+ 87-line orphan schema counts, the scheduler-ABI stability claim, and the journaled
142
+ 0.9.0 migration extension point all check out.
143
+
144
+ ## Convergent verdict
145
+
146
+ Direction (markdown tasks, uses:/run:, steps-are-tasks, cascade *shape*) survives.
147
+ The spec's §10 non-goals are false: this IS an IR + freeze + hash-version change and must
148
+ be costed as one. Required redesigns before implementation: keep two output concepts;
149
+ specify the shell unit kind in IR + dispatch; freeze-time prose concat + hash bump; build
150
+ (not "expose") the 5-layer cascade; split params' meanings (GHA's inputs/with split exists
151
+ precisely for this); a security/activation-policy design for script execution; rewrite §8
152
+ migration against the real migrator mechanics.
@@ -0,0 +1,352 @@
1
+ # akm workflow engine — third-party library survey
2
+
3
+ Date: 2026-08-01. Scope: find a TS/JS library **measurably better** than the two
4
+ already under review (`bunqueue`, `openworkflow` — deliberately excluded here) for
5
+ replacing akm's hand-rolled engine in `src/workflows/`.
6
+
7
+ ---
8
+
9
+ ## 0. What akm actually needs (measured from the code)
10
+
11
+ Sizes (`wc -l`, MPL-2.0 headers included):
12
+
13
+ | area | LOC |
14
+ |---|---|
15
+ | `src/workflows/exec` | 7,070 |
16
+ | `src/workflows/ir` | 1,635 |
17
+ | **exec + ir (the replacement target)** | **8,705** |
18
+ | `src/workflows/runtime` | 1,889 |
19
+ | `src/workflows` total | 13,046 |
20
+
21
+ Hard requirements read out of the code, not assumed:
22
+
23
+ 1. **Short-lived process, no daemon.** `akm workflow run` is a one-shot CLI. The
24
+ header of `/home/user/akm/src/workflows/exec/run-workflow.ts` documents an
25
+ explicit drain of child-process handles so the event loop closes and the
26
+ process exits — there is no resident engine and adding one is a regression.
27
+ 2. **SQLite already is the journal.** `workflow_runs`, `workflow_run_steps`,
28
+ `workflow_run_units` in `state.db`, all raw SQL in
29
+ `/home/user/akm/src/storage/repositories/workflow-runs-repository.ts`, migrated
30
+ by `/home/user/akm/src/storage/engines/sqlite-migrations.ts`.
31
+ 3. **Multi-process safety by lease, not by singleton.** 90-second
32
+ `engine_lease_holder`/`engine_lease_until` on the run row; expired leases are
33
+ claimable (crash recovery); a second `workflow run` on a live-leased run
34
+ refuses. Concurrent *read-only* `akm workflow brief` runs against the same DB
35
+ by design.
36
+ 4. **Content-derived unit identity for resume.** `<node_id>:<sha256(canonicalJson(item))[:12]>`
37
+ — resume reuses journaled results even if the producer re-emits items in a
38
+ different order. This is stronger than the position/replay identity every
39
+ generic engine uses.
40
+ 5. **A frozen data plan, not code-defined workflows.** IR v3
41
+ (`/home/user/akm/src/workflows/ir/schema.ts`): `unit | agent | map | gate`
42
+ nodes, `route` specs, per-engine frozen concurrency caps, `plan_hash`
43
+ integrity, budget caps. Authored as YAML/markdown, compiled and frozen into
44
+ `plan_json`. Every generic library expects workflows expressed as *TypeScript
45
+ functions*.
46
+ 6. **A harness-neutral external driver protocol.** `brief.ts` (713) + `report.ts`
47
+ (1,977) let an outside agent session execute units and report back, producing
48
+ byte-identical unit graphs to the native engine. 2,690 LOC that no library has
49
+ any analogue for.
50
+ 7. **Zero-native-addon distribution.** Runtime deps are 7 tiny pure-JS packages;
51
+ `better-sqlite3` is *optional*. `.github/workflows/release.yml` compiles
52
+ `bun-linux-x64/arm64`, `bun-darwin-x64/arm64`, **`bun-windows-x64`** via
53
+ `bun build --compile`. A hard native dependency breaks the standalone binary.
54
+ 8. **Long-running steps.** Units are LLM/agent invocations with per-invocation
55
+ `timeoutMs` up to `2**31-1` ms.
56
+ 9. **MPL-2.0 distribution** — needs MIT/Apache-2.0/BSD/ISC.
57
+
58
+ The generic, library-shaped slice of exec+ir is small:
59
+ `scheduler.ts` (118) + the lease/resume plumbing inside `run-workflow.ts` (~325 of
60
+ 814) + retry/concurrency wiring inside `native-executor.ts` (~130 of 1,334)
61
+ ≈ **570 LOC ≈ 6.5 % of exec+ir**. Everything else is akm's authoring format, its
62
+ gate semantics, its prompt/artifact model, and its driver protocol.
63
+
64
+ ---
65
+
66
+ ## 1. Eliminated on the no-server constraint (one line each, verified)
67
+
68
+ | Candidate | Evidence |
69
+ |---|---|
70
+ | Temporal | `@temporalio/worker@1.21.1` deps include `@grpc/grpc-js` — the SDK is a gRPC client of a separate Temporal Server cluster. |
71
+ | Inngest | `inngest@4.14.0` is an SDK; execution is driven by `inngest-cli@1.40.0` ("workflow orchestration platform… run on servers") or Inngest Cloud calling back into your HTTP endpoint. |
72
+ | Trigger.dev | Tasks execute inside Trigger.dev's own runners (cloud or self-hosted Docker stack); the package is a client. |
73
+ | Hatchet | `@hatchet-dev/typescript-sdk@1.28.1` is a worker client for the Hatchet engine (Postgres + gRPC engine service). |
74
+ | Windmill | Rust worker + Postgres server product; TS is the *script* language, not an embeddable library. |
75
+ | n8n | Full Node application/server with its own DB and editor UI; not a library. |
76
+ | Restate | Requires the Restate runtime/sidecar to invoke and journal handlers. |
77
+ | Netflix Conductor / Orkes | Java server + Elasticsearch/Redis/Postgres; TS SDK is a client. |
78
+ | Camunda / Zeebe | Zeebe broker cluster; `zeebe-node`/`@camunda8/sdk` are gRPC job-worker clients. |
79
+ | Azure Durable Functions | `durable-functions@3.5.0` requires the Azure Functions host + Durable Task storage provider. |
80
+ | Dapr Workflow | `@dapr/durabletask-js@1.0.0` talks to the Dapr sidecar / durabletask gRPC endpoint. |
81
+ | AWS durable execution | `@aws/durable-execution-sdk-js@2.2.0` — Lambda-hosted durable functions. |
82
+ | Convex | `@convex-dev/workflow@0.4.4` is a component of the hosted Convex backend. |
83
+ | Cloudflare Workflows | Workers/Durable Objects runtime only. |
84
+ | Vercel Workflow DevKit | `workflow@4.8.0` ships Next/Nuxt/Astro/Nitro/SvelteKit/Nest adapters — a web-framework durable-function SDK bound to a deployed "world", not a CLI library. |
85
+ | Upstash Workflow | `@upstash/workflow` — QStash HTTP service re-invokes your endpoint per step. |
86
+ | Obelisk | Rust/WASM engine shipped as a standalone binary, not a TS library. |
87
+ | HotMesh | `@hotmeshio/hotmesh@0.27.0` peerDeps `pg` **and** `nats`; also `SEE LICENSE IN LICENSE` (non-standard). |
88
+ | Resonate | `@resonatehq/sdk@0.11.4` peerDeps `pg` + `@nats-io/transport-node`; local mode is in-memory (not crash-durable), durability needs the Resonate server/Postgres. |
89
+ | Smithers | `smithers-orchestrator@0.32.0` is an *application* (React UI, `@smithers-orchestrator/{ui,aws,gcp,cli,driver,engine}`), not an embeddable engine. |
90
+ | Eve (Vercel) | `eve@0.29.4` is a Nitro-based agent *framework* (`nitro` dep, `node>=24`), an app scaffold not a library. |
91
+ | RaySpec | `@rayspec/workflow-durable@1.6.2` delegates durability to `@rayspec/durable-dbos` → DBOS → Postgres; 1 week old, no adoption. |
92
+
93
+ ## 2. Eliminated on the storage constraint
94
+
95
+ | Candidate | Evidence |
96
+ |---|---|
97
+ | **DBOS Transact (TS)** | **Verified against the current artifact, not memory.** `@dbos-inc/dbos-sdk@4.25.14`, published **2026-07-30**: only DB dependency is `pg@^8.11.3`; the unpacked tarball contains **zero** files matching `*sqlite*`; the only DSN scheme in `dist/src/*.js` is `postgresql://`; `README.md` still says "a lightweight **Postgres-backed** library". Every `@dbos-inc/*-datasource` package is explicitly "with PostgreSQL support". DBOS's June-2026 announcement of a SQLite durability backend applies to the **Go** SDK (and Python, whose docs default the system DB to SQLite) — **it has not landed in TypeScript.** Verdict: **fail today**, re-check when a TS SQLite system DB ships. |
98
+ | pg-boss | `pg-boss@12.26.4` deps `pg` — Postgres-only by construction. |
99
+ | BullMQ | `bullmq@6.0.5` — "Queue for messages and jobs based on Redis"; requires a Redis server. |
100
+ | Absurd | `absurd-sdk@0.4.0` — "PostgreSQL-based durable task execution". |
101
+ | Agenda / node-resque / bee-queue | MongoDB / Redis / Redis respectively. |
102
+ | SideQuest | `@sidequest/engine@1.16.2` is **LGPL-3.0-or-later** — copyleft on a linked library; avoid for a distributed CLI. |
103
+
104
+ ## 3. Eliminated as "not orchestrators"
105
+
106
+ | Candidate | Evidence |
107
+ |---|---|
108
+ | bree | `bree@9.2.9` — cron/date scheduler that spawns worker threads. No DAG, no journal, no resume. |
109
+ | croner | `croner@10.0.1` — zero-dep cron expression evaluator. Schedule only. akm already gets scheduling from `schtasks`/cron in `src/tasks/`. |
110
+ | better-queue | `better-queue@3.8.12` — in-process job queue with pluggable stores; no step journal, no fan-out graph, no resume-mid-workflow. |
111
+ | p-queue / p-limit / fastq | Concurrency limiters. akm already has `core/concurrent.ts` + `scheduler.ts` doing exactly this with the extra frozen-cap policy. |
112
+ | workflow-es | `workflow-es@2.3.5`, **last published 2022-06-29**, 19 versions, deps on `inversify@^4` + `reflect-metadata@^0.1` (both several majors stale). Unmaintained; TS-decorator/DI-heavy; would not build cleanly under Bun + modern TS. Dead. |
113
+ | @deepkit/workflow | FSM only (`1.0.19`, Sep 2025); no persistence, no durability. |
114
+
115
+ ---
116
+
117
+ ## 4. Candidates evaluated in full
118
+
119
+ Rubric: **server-free embed / SQLite durability + resume / orchestration primitives /
120
+ long-step tolerance / maturity / % of exec+ir replaced.**
121
+
122
+ ### 4.1 Weft — `@lostgradient/weft@0.16.0` (MIT)
123
+
124
+ The only library found that was *designed* for akm's runtime shape.
125
+
126
+ - Bun-native (`engines: {bun: ">=1.3.13"}`), 4.6 MB, deps `zod` + `@msgpack/msgpack`.
127
+ - Storage adapters are subpath exports, including **`./storage/sqlite/bun`** — i.e.
128
+ `bun:sqlite`, **no native addon**, which is the one thing LangGraph gets wrong.
129
+ Also `./storage/sqlite/node`, `lmdb`, `turso`, `neon`, `postgres`, `http`, `memory`.
130
+ - Checkpoint-per-`yield*` (state snapshot, no replay-determinism constraint), so a
131
+ 30-minute LLM step is fine.
132
+ - Primitives: `ctx.all()`, `ctx.race()`/`raceKeyed()`, activity retry policies,
133
+ `ctx.sleep()` durable timers, `ctx.waitUntil(pred, timeout)`, `waitForSignal()`,
134
+ mutex + semaphore.
135
+ - Windows: `bun build --compile` targets include `windows-x64` — matches akm's
136
+ release matrix exactly.
137
+
138
+ **Killer flaw — the concurrency model is the opposite of akm's.** From the README:
139
+ `"Run a single engine per durable store; pointing two at the same store is not yet
140
+ coordinated and can double-resume a workflow"`, plus
141
+ `"Engine.create() recovers by default after registering workflow definitions, so
142
+ fresh processes resume persisted running workflows"`. For akm that means every
143
+ `akm workflow run <x>` boot would auto-resume *every* persisted running workflow,
144
+ and two overlapping CLI invocations can double-execute. akm's 90-second run lease
145
+ exists precisely to make N short-lived processes safe against one SQLite file;
146
+ Weft has no equivalent and tells you to enforce singleton-ness "in infrastructure".
147
+ Docs also state the server runtime is Bun-only for this launch line.
148
+
149
+ **Maturity — disqualifying for a shipping CLI.** GitHub `stevekinney/weft`:
150
+ **7 stars, 1 fork, sole maintainer, bus factor 1.** npm: first publish
151
+ **2026-06-03**, 16 versions, latest 2026-07-25 — **eight weeks old**. Explicitly
152
+ pre-1.0 with an experimental/candidate-stable tier split and an incomplete "Tier-0".
153
+ 1,065 commits in 8 weeks by one person is a velocity profile that is as likely to
154
+ be abandoned as to reach 1.0.
155
+
156
+ | criterion | |
157
+ |---|---|
158
+ | server-free embed | **partial** — in-process, but assumes one long-lived engine per store |
159
+ | SQLite durability + resume | **pass** — `bun:sqlite` adapter, checkpoint per yield |
160
+ | orchestration primitives | **pass** — all/race/retry/timers/signals/semaphore |
161
+ | long-running steps | **pass** |
162
+ | maturity | **fail** — 7★, 8 weeks old, bus factor 1, pre-1.0 |
163
+ | % exec+ir replaced | **~6 %** (scheduler + lease/resume plumbing), and it *removes* the lease guarantee |
164
+
165
+ ### 4.2 Mastra workflows — `@mastra/core@1.55.0` + `@mastra/libsql@1.18.0` (Apache-2.0)
166
+
167
+ - Genuinely server-free for embedding: `mastra dev` is an optional playground; the
168
+ workflow engine runs in-process via `workflow.createRunAsync()`.
169
+ - Storage is pluggable; `@mastra/libsql` wraps `@libsql/client` and takes a
170
+ `file:` URL, so local SQLite durability is real and supported. Snapshots survive
171
+ restarts; `workflow.getWorkflowRunById()` + `createWorkflowStateReader()` recover a
172
+ run in a brand-new process.
173
+ - Control flow: `.then/.parallel/.branch/.dowhile/.dountil/.foreach({concurrency})`,
174
+ step retries, suspend/resume. Good coverage of akm's `unit/map/route`.
175
+ - License fine. Maintained (1,437 releases since Oct 2024).
176
+
177
+ **Why it does not win:**
178
+ - **Durability model mismatch.** Mastra's snapshots are written *on suspend*
179
+ (`suspend()`, `sleep()`, human-in-the-loop). It has no run lease, no
180
+ crash-recovery daemon, and no per-unit idempotency key equivalent to akm's
181
+ content-derived `sha256(item)` unit ids. akm would keep hand-rolling exactly the
182
+ parts it already hand-rolls.
183
+ - **Weight is disqualifying for this CLI.** `@mastra/core` alone is **59 MB
184
+ unpacked / 2,862 files / 31 runtime deps**, including three parallel copies of the
185
+ AI SDK provider layer (`@ai-sdk/provider-v5/v6/v7`), `execa`, `ws`,
186
+ `@modelcontextprotocol/sdk`, and **`posthog-node`** (vendor telemetry). akm's
187
+ entire runtime dependency set today is 7 small pure-JS packages and it ships a
188
+ compiled single binary. This is a >10× install-surface increase plus a telemetry
189
+ dependency in a tool whose repo carries `docs/reference/data-and-telemetry.md`.
190
+ - **Release churn.** ~1,437 versions in 22 months (~2/day) against a CLI that pins
191
+ deps hard (see the `pinNotes` entry in `package.json`).
192
+ - akm would still own the IR compiler, gates, artifact promotion, brief/report.
193
+
194
+ | criterion | |
195
+ |---|---|
196
+ | server-free embed | **pass** |
197
+ | SQLite durability + resume | **partial** — libSQL storage yes; snapshot-on-suspend, no lease, no crash-resume daemon |
198
+ | orchestration primitives | **pass** — parallel/branch/loops/foreach-concurrency/retries |
199
+ | long-running steps | **pass** |
200
+ | maturity | **partial** — active and adopted, but 59 MB, 31 deps, posthog telemetry, extreme churn |
201
+ | % exec+ir replaced | **~10–15 %** of exec, **0 %** of ir |
202
+
203
+ ### 4.3 XState v5 — `xstate@5.32.5` (MIT)
204
+
205
+ - Best maturity on this list: MIT, **zero dependencies**, 2.3 MB, Stately-backed,
206
+ huge install base, stable v5 line.
207
+ - Persistence exists — `actor.getPersistedSnapshot()` / `createActor(m, { snapshot })` —
208
+ and machines can be built at runtime from akm's frozen IR JSON.
209
+
210
+ **But it is a state-machine library, not a durable execution engine.** What akm
211
+ would *still* hand-roll after adopting it: the unit journal and its SQLite schema,
212
+ content-derived unit ids and idempotent resume, retry/backoff, the frozen
213
+ concurrency caps, the 90-second run lease, gate loops and feedback threading,
214
+ artifact promotion/validation, and the entire brief/report protocol. Worse, a
215
+ restored XState actor **re-invokes** its promise actors — the invoked LLM call is
216
+ not journaled, so naive restore *re-runs paid work*. akm would have to wrap every
217
+ invoke in its existing journal anyway, at which point XState is contributing only
218
+ step sequencing and route evaluation (~300–500 LOC of `run-workflow.ts` +
219
+ `step-work.ts`), while adding a second source of truth for run state next to
220
+ `workflow_runs`.
221
+
222
+ | criterion | |
223
+ |---|---|
224
+ | server-free embed | **pass** |
225
+ | SQLite durability + resume | **fail** — snapshot serialization only; no journal, no effect durability, no resume semantics |
226
+ | orchestration primitives | **partial** — parallel states/routing yes; no concurrency caps, no retry policy, no fan-out-over-data |
227
+ | long-running steps | **pass** |
228
+ | maturity | **pass** — the strongest here |
229
+ | % exec+ir replaced | **~4–6 %**, and it duplicates run state |
230
+
231
+ ### 4.4 Effect — `@effect/workflow@0.19.1` + `@effect/cluster@0.60.2` (MIT)
232
+
233
+ Durable workflows for Effect: `DurableDeferred`, `DurableClock`, activity
234
+ journaling, compensation. The only real engine is `ClusterWorkflowEngine`, which
235
+ maps each workflow to a cluster Entity and routes through `Sharding` — so you take
236
+ on `@effect/cluster` + `@effect/sql` + `@effect/rpc` + `@effect/platform` +
237
+ `@effect/experimental` as peers, and a runner topology.
238
+
239
+ **Directly disqualifying evidence for akm's exact pattern:** two *open* upstream
240
+ issues — [Effect-TS/effect#6176](https://github.com/Effect-TS/effect/issues/6176)
241
+ (filed 2026-04-15, still open) and #6179 — report that SQLite-backed
242
+ `@effect/workflow`/`@effect/cluster` storage degrades under
243
+ "one persistent runner + multiple short-lived client processes on the same SQLite
244
+ store", producing `PersistenceError` and `SqliteError: database is locked`. That is
245
+ *precisely* akm's topology (one engine invocation + concurrent `brief`/`report`
246
+ CLI processes on `state.db`). Plus: adopting Effect means rewriting akm's
247
+ imperative engine into the Effect runtime — an enormous, non-incremental change to
248
+ an MPL-2.0 codebase that today has 7 dependencies.
249
+
250
+ | criterion | |
251
+ |---|---|
252
+ | server-free embed | **fail/partial** — needs cluster runner topology |
253
+ | SQLite durability + resume | **fail** — documented, currently-open lock failures under akm's multi-process pattern |
254
+ | orchestration primitives | **pass** |
255
+ | long-running steps | **pass** |
256
+ | maturity | **partial** — Effect core is mature; `@effect/workflow` is 0.19.x and moving fast |
257
+ | % exec+ir replaced | ~15 % nominally, at the cost of rewriting the other 85 % in Effect |
258
+
259
+ ### 4.5 LangGraph JS — `@langchain/langgraph@1.4.8` + `@langchain/langgraph-checkpoint-sqlite@1.0.3` (MIT)
260
+
261
+ Closest "real product" fit conceptually: graph of nodes, `Send` API for
262
+ data-driven fan-out, `interrupt()`/`Command(resume=…)`, retry policies, per-thread
263
+ checkpoints in SQLite, no server required (LangGraph Platform is optional).
264
+
265
+ Blockers:
266
+ - **`@langchain/langgraph-checkpoint-sqlite` depends on `better-sqlite3@^12`** — a
267
+ native addon. akm keeps `better-sqlite3` *optional* precisely so
268
+ `bun build --compile` produces a runtime-free binary for 5 targets including
269
+ Windows. Making it mandatory is a distribution regression; the package does not
270
+ offer a `bun:sqlite` driver.
271
+ - Upstream positions `SqliteSaver` as "local testing"; Postgres is the documented
272
+ production saver.
273
+ - Checkpointing is at **superstep boundaries**, so a crash mid-node re-runs the
274
+ whole node — weaker than akm's per-unit content-hash journal, i.e. it would
275
+ re-pay for LLM calls akm currently reuses.
276
+ - Pulls `@langchain/core` (peer) + `@langchain/langgraph-sdk` + `@langchain/protocol`
277
+ into a 7-dependency CLI.
278
+ - Graph-of-code model vs. akm's frozen IR data plan; `brief`/`report` have no home.
279
+
280
+ | criterion | |
281
+ |---|---|
282
+ | server-free embed | **pass** |
283
+ | SQLite durability + resume | **partial** — works, but native addon + "local testing" positioning + superstep granularity |
284
+ | orchestration primitives | **pass** — Send fan-out, interrupts, retry policies |
285
+ | long-running steps | **partial** — node-level replay on crash |
286
+ | maturity | **pass** — large ecosystem, MIT |
287
+ | % exec+ir replaced | **~10 %**, and it breaks single-binary distribution |
288
+
289
+ ### 4.6 Also looked at, not worth a full row
290
+
291
+ - `@clawdbot/lobster@2026.6.11` (MIT, deps `ajv`+`yaml`) — "typed JSON-first
292
+ pipelines, jobs, and approval gates", local-first, fan-out/retries/timeouts.
293
+ Conceptually the closest thing to akm's gate model found on npm. But it is an
294
+ **OpenClaw-native plugin shell**, still described as in planning, with no
295
+ documented durable journal or resume contract and no adoption. Not a credible
296
+ swap; possibly worth watching.
297
+ - `liteflow@1.1.0` — "a lightweight SQLite-based workflow *tracker*". Tracking, not
298
+ execution. No fan-out, no retries, no resume.
299
+ - `@gobing-ai/ts-dual-workflow-engine`, `@pi-stef/agent-workflows`,
300
+ `nervous-system`, `@workglow/job-queue` — sub-1.0, single-author, no adoption,
301
+ no durability contract. Same or worse risk profile than Weft with fewer features.
302
+
303
+ ---
304
+
305
+ ## 5. Ranked shortlist
306
+
307
+ 1. **Weft (`@lostgradient/weft`)** — the only library whose *design* matches akm
308
+ (Bun-native, `bun:sqlite`, in-process, checkpoint-per-step, MIT, Windows
309
+ compile target), but it explicitly does not coordinate multiple processes
310
+ against one store and auto-resumes everything on `Engine.create()`, which
311
+ contradicts akm's lease model; and at 7 stars / 8 weeks / bus factor 1 it is
312
+ not adoptable by a shipping CLI. **Watch, do not adopt.**
313
+ 2. **Mastra (`@mastra/core` + `@mastra/libsql`)** — real server-free SQLite
314
+ durability and the best control-flow coverage of akm's `unit/map/route`, but
315
+ 59 MB / 31 deps / bundled `posthog-node` / ~2 releases-per-day churn is
316
+ indefensible against a 7-dependency single-binary CLI, and its
317
+ snapshot-on-suspend model leaves akm hand-rolling leases and unit idempotency
318
+ anyway.
319
+ 3. **XState v5** — by far the safest dependency (MIT, zero deps, 2.3 MB, stable),
320
+ but it is not durable execution: restored actors re-invoke their effects, so
321
+ akm keeps its journal, lease, retries and gates and gains only step
322
+ sequencing — while creating a second run-state source of truth.
323
+
324
+ ## 6. Bottom line
325
+
326
+ **Nothing found beats hand-rolling, and nothing found is measurably better than
327
+ the two candidates already under review.**
328
+
329
+ The reason is structural, not a gap in the search. akm's engine is 8,705 LOC of
330
+ exec+ir, but only ~570 of them (~6 %) are the generic durable-execution concerns a
331
+ library sells: bounded concurrency, retry, journal-and-resume, lease. The other
332
+ ~94 % is akm's own product — the IR v3 compiler and freeze/plan-hash pipeline, the
333
+ LLM/agent/SDK dispatch with frozen per-engine caps, artifact promotion and
334
+ output-schema validation, artifact-judged gates with bounded feedback loops, and
335
+ the 2,690-LOC `brief`/`report` harness-neutral driver protocol. No library on npm
336
+ has an analogue for the last item, and every library would *replace* akm's
337
+ `workflow_run_units` journal with its own schema, which is the exact table
338
+ `brief`/`report` read from — so adoption costs an extra translation layer on top
339
+ of the rewrite.
340
+
341
+ Three specific things akm already does that none of these libraries do:
342
+ content-derived unit identity (`sha256(canonicalJson(item))`) that survives item
343
+ reordering; a claimable 90-second run lease that makes N short-lived CLI processes
344
+ safe against one SQLite file; and byte-identical unit graphs across the native and
345
+ external-driver execution paths.
346
+
347
+ **Recommendation:** keep the engine. If a dependency is wanted, the defensible
348
+ scope is *below* the engine, not instead of it — e.g. keep using `core/concurrent.ts`
349
+ or swap it for `p-limit`/`p-queue`. Re-open this evaluation if
350
+ **DBOS Transact TS ships a SQLite system database** (Go has it, Python defaults to
351
+ it, TS at `4.25.14`/2026-07-30 does not), or if **Weft reaches 1.0 with documented
352
+ multi-process lease coordination**.