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
@@ -5,9 +5,10 @@
5
5
  * Reading a run row's frozen plan: the ONE plan decoder and its tolerant
6
6
  * row-level wrapper.
7
7
  *
8
- * {@link decodeWorkflowPlan} accepts every plan shape a release has stored —
9
- * irVersion 4 and 5 (with their `sourceReadSet` and host-identity fields) as
10
- * well as the current one — and keeps keys it does not know rather than
8
+ * {@link decodeWorkflowPlan} accepts every plan shape a release at or above
9
+ * the 0.9.15 floor has stored — irVersion 5 (with its `sourceReadSet` and
10
+ * host-identity fields, which 0.9.15 and 0.9.16 wrote) as well as the current
11
+ * one — and keeps keys it does not know rather than
11
12
  * refusing them. It rejects only a plan it cannot run: no steps, a unit with
12
13
  * no frozen target, a request that does not decode. `plan_ir_version` and
13
14
  * `plan_hash` are informational columns: neither gates execution. A plan that
@@ -62,30 +63,17 @@ export function frozenStepRows(plan) {
62
63
  ? step.root.kind === "map"
63
64
  ? step.root.template.instructions
64
65
  : step.root.instructions
65
- : routeInstructions(step.route),
66
+ : "",
66
67
  completionJson: step.gate.criteria.length > 0 ? JSON.stringify(step.gate.criteria) : null,
67
68
  sequenceIndex: step.sequenceIndex,
68
69
  }));
69
70
  }
70
- function routeInstructions(route) {
71
- const branches = Object.entries(route.when)
72
- .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
73
- .map(([match, stepId]) => `"${match}" -> ${stepId}`);
74
- if (route.defaultStepId !== undefined)
75
- branches.push(`default -> ${route.defaultStepId}`);
76
- return `Route on ${route.input}: ${branches.join(", ")}.`;
77
- }
78
71
  /** Decode a stored plan (any release's) into the one plan type. */
79
72
  export function decodeWorkflowPlan(input, options = {}) {
80
73
  const raw = record(input, "plan");
81
74
  if (!Array.isArray(raw.steps) || raw.steps.length === 0)
82
75
  fail("steps must be a non-empty array");
83
76
  const steps = raw.steps.map((value, index) => decodeStep(value, index));
84
- if (raw.outputs !== undefined) {
85
- for (const [name, entry] of Object.entries(record(raw.outputs, "outputs"))) {
86
- string(record(entry, `outputs.${name}`).from, `outputs.${name}.from`);
87
- }
88
- }
89
77
  const sourceHash = typeof raw.sourceHash === "string" ? raw.sourceHash : legacySourceHash(raw.sourceReadSet, options.workflowRef);
90
78
  return {
91
79
  ...raw,
@@ -109,28 +97,18 @@ function legacySourceHash(readSet, workflowRef) {
109
97
  function decodeStep(value, index) {
110
98
  const step = record(value, `step ${index}`);
111
99
  const stepId = string(step.stepId, `step ${index} stepId`);
112
- const route = step.route === undefined ? undefined : decodeRoute(step.route, stepId);
113
- const root = step.root === undefined ? undefined : decodeNode(step.root, stepId);
114
- if (!root && !route)
115
- fail(`step ${stepId} has neither a frozen root nor a route`);
100
+ if (step.root === undefined)
101
+ fail(`step ${stepId} has no frozen root`);
102
+ const root = decodeNode(step.root, stepId);
116
103
  return {
117
104
  ...step,
118
105
  stepId,
119
106
  title: typeof step.title === "string" ? step.title : stepId,
120
107
  sequenceIndex: index,
121
- ...(root ? { root } : {}),
122
- ...(route ? { route } : {}),
108
+ root,
123
109
  gate: decodeGate(step.gate, stepId),
124
110
  };
125
111
  }
126
- function decodeRoute(value, stepId) {
127
- const route = record(value, `step ${stepId} route`);
128
- string(route.input, `step ${stepId} route.input`);
129
- const when = record(route.when, `step ${stepId} route.when`);
130
- for (const target of Object.values(when))
131
- string(target, `step ${stepId} route target`);
132
- return route;
133
- }
134
112
  function decodeNode(value, stepId) {
135
113
  const node = record(value, `step ${stepId} root`);
136
114
  if (node.kind !== "map")
@@ -154,7 +132,6 @@ function decodeUnit(node, stepId) {
154
132
  id,
155
133
  instructions: typeof node.instructions === "string" ? node.instructions : "",
156
134
  onError: node.onError === "continue" ? "continue" : "fail",
157
- isolation: node.isolation === "worktree" ? "worktree" : "none",
158
135
  frozenTarget: decodeTarget(node.frozenTarget, label),
159
136
  environment: Array.isArray(node.environment)
160
137
  ? node.environment.map((binding, index) => decodeEnvironmentBinding(binding, `${label} environment[${index}]`))
@@ -180,11 +157,7 @@ function decodeGate(value, stepId) {
180
157
  function decodeTarget(value, label) {
181
158
  const target = record(value, `${label} frozenTarget`);
182
159
  const inputBindings = decodeInputBindings(target.inputBindings, label);
183
- const gitCommitOid = typeof target.gitCommitOid === "string" ? target.gitCommitOid : undefined;
184
- const optional = {
185
- ...(gitCommitOid ? { gitCommitOid } : {}),
186
- ...(inputBindings ? { inputBindings } : {}),
187
- };
160
+ const optional = inputBindings ? { inputBindings } : {};
188
161
  switch (target.kind) {
189
162
  case "command":
190
163
  return decodeCommandTarget(target, label);
@@ -196,20 +169,6 @@ function decodeTarget(value, label) {
196
169
  cwdIdentity: record(target.cwdIdentity, `${label} cwdIdentity`),
197
170
  ...optional,
198
171
  };
199
- case "script":
200
- return {
201
- kind: "script",
202
- ref: string(target.ref, `${label} script ref`),
203
- contentHash: string(target.contentHash, `${label} contentHash`),
204
- exec: decodeExec(target.exec, label),
205
- interpreter: string(target.interpreter, `${label} interpreter`),
206
- extension: string(target.extension, `${label} extension`),
207
- bytesBase64: typeof target.bytesBase64 === "string" ? target.bytesBase64 : fail(`${label} has no script bytes`),
208
- byteLength: typeof target.byteLength === "number" ? target.byteLength : 0,
209
- cwdIdentity: record(target.cwdIdentity, `${label} cwdIdentity`),
210
- materialization: "ephemeral-0700-delete",
211
- ...optional,
212
- };
213
172
  case "child-workflow":
214
173
  return {
215
174
  kind: "child-workflow",
@@ -217,7 +176,7 @@ function decodeTarget(value, label) {
217
176
  planHash: string(target.planHash, `${label} planHash`),
218
177
  frozenPlan: decodeWorkflowPlan(target.frozenPlan),
219
178
  contentHash: string(target.contentHash, `${label} contentHash`),
220
- via: target.via === "task" ? "task" : "direct",
179
+ ...(target.via === "task" || target.via === "direct" ? { via: target.via } : {}),
221
180
  ...(typeof target.taskRef === "string" ? { taskRef: target.taskRef } : {}),
222
181
  ...(inputBindings ? { inputBindings } : {}),
223
182
  };
@@ -247,7 +206,6 @@ function decodeCommandTarget(target, label) {
247
206
  ...(target.cwdIdentity && typeof target.cwdIdentity === "object"
248
207
  ? { cwdIdentity: target.cwdIdentity }
249
208
  : {}),
250
- ...(typeof target.gitCommitOid === "string" ? { gitCommitOid: target.gitCommitOid } : {}),
251
209
  ...(inputBindings ? { inputBindings } : {}),
252
210
  };
253
211
  }
@@ -13,12 +13,11 @@ import { getCurrentWorkflowScopeKey } from "../authoring/scope-key.js";
13
13
  import { frozenSummaryJudge } from "../exec/frozen-judge.js";
14
14
  import { detectSecretShapedParams } from "../exec/param-secrets.js";
15
15
  import { freezeWorkflow } from "../freeze/freeze.js";
16
- import { materializeWorkflowParameterFlags, validateWorkflowParams } from "../ir/params.js";
16
+ import { applyWorkflowParamDefaults, materializeWorkflowParameterFlags, validateWorkflowParams, } from "../ir/params.js";
17
17
  import { canonicalPlanJson, computePlanHash } from "../ir/plan-hash.js";
18
18
  import { clip, WORKFLOW_UNIT_DIAGNOSTIC_CLIP } from "../resource-limits.js";
19
19
  import { validateStepSummary } from "../validate-summary.js";
20
20
  import { resolveAgentIdentity } from "./agent-identity.js";
21
- import { resolveWorkflowRunOutputs } from "./run-outputs.js";
22
21
  import { frozenStepRows, readRunPlan } from "./run-plan.js";
23
22
  import { canonicalizeWorkflowRefInput, loadWorkflowAsset, resolveWorkflowEntryId } from "./workflow-asset-loader.js";
24
23
  /**
@@ -76,9 +75,7 @@ export async function startWorkflowRun(ref, params = {}, options) {
76
75
  if (options?.parameterFlags?.length && Object.keys(params).length > 0) {
77
76
  throw new UsageError("Workflow parameters must use either an object or per-parameter flags, not both.");
78
77
  }
79
- const effectiveParams = options?.parameterFlags?.length
80
- ? materializeWorkflowParameterFlags(plan, options.parameterFlags)
81
- : params;
78
+ const effectiveParams = applyWorkflowParamDefaults(plan, options?.parameterFlags?.length ? materializeWorkflowParameterFlags(plan, options.parameterFlags) : params);
82
79
  // Non-fatal WARNINGS: untyped-step and undeclared-param advisories surface
83
80
  // as `warn()` lines at start (stderr, consistent with the repo's other
84
81
  // author-facing warnings) without blocking the run.
@@ -394,10 +391,9 @@ export async function completeWorkflowStep(input) {
394
391
  return withWorkflowRunsRepo((repo) => {
395
392
  let updatedRun;
396
393
  let refreshedSteps = [];
397
- let outputWarnings;
398
394
  repo.transaction(() => {
399
395
  const run = readWorkflowRun(repo, input.runId);
400
- const plan = requireRunPlan(run);
396
+ const _plan = requireRunPlan(run);
401
397
  if (run.status !== "active") {
402
398
  throw new UsageError(`Workflow run ${run.id} is ${run.status} and cannot be updated.`);
403
399
  }
@@ -428,15 +424,6 @@ export async function completeWorkflowStep(input) {
428
424
  });
429
425
  refreshedSteps = readWorkflowRunSteps(repo, run.id);
430
426
  const state = deriveRunState(refreshedSteps);
431
- // Declared outputs resolve inside this transaction once the run
432
- // completes; a failure rolls the step completion back whole.
433
- let outputsJson; // undefined = untouched, keep the row's existing value
434
- if (state.status === "completed" && plan.outputs) {
435
- const resolved = resolveWorkflowRunOutputs(plan, refreshedSteps);
436
- outputsJson = JSON.stringify(resolved.outputs);
437
- repo.setRunOutputs(run.id, outputsJson);
438
- outputWarnings = resolved.errors;
439
- }
440
427
  repo.updateRunState({
441
428
  status: state.status,
442
429
  currentStepId: state.currentStepId,
@@ -450,16 +437,9 @@ export async function completeWorkflowStep(input) {
450
437
  current_step_id: state.currentStepId,
451
438
  updated_at: completedAt,
452
439
  completed_at: state.completedAt,
453
- ...(outputsJson !== undefined ? { outputs_json: outputsJson } : {}),
454
440
  };
455
441
  });
456
442
  const detail = buildWorkflowRunDetail(repo, updatedRun, refreshedSteps);
457
- if (outputWarnings?.length) {
458
- const messages = outputWarnings.map((e) => `Workflow run ${input.runId} declared ${e}`);
459
- for (const message of messages)
460
- warn(message);
461
- detail.warnings = [...(detail.warnings ?? []), ...messages];
462
- }
463
443
  // #11: emit `workflow_step_completed` ONLY for a genuine `completed`
464
444
  // transition; every other non-pending status (failed/skipped/blocked)
465
445
  // carries the honest `workflow_step_updated` name. The status is ALWAYS
@@ -680,10 +660,7 @@ function toWorkflowRunSummary(run) {
680
660
  agentHarness: run.agent_harness ?? null,
681
661
  agentSessionId: run.agent_session_id ?? null,
682
662
  planIrVersion: run.plan_ir_version ?? null,
683
- // P3b: all three optional and conditionally spread, so every
684
- // pre-existing (non-child, no-outputs-declared) run's envelope is
685
- // byte-identical.
686
- ...(run.outputs_json ? { outputs: parseJsonObject(run.outputs_json) ?? {} } : {}),
663
+ // Optional and conditionally spread, so a non-child run's envelope is unchanged.
687
664
  ...(run.parent_run_id ? { parentRunId: run.parent_run_id } : {}),
688
665
  ...(run.parent_unit_id ? { spawnedByUnitId: run.parent_unit_id } : {}),
689
666
  };
@@ -4,11 +4,9 @@
4
4
  /**
5
5
  * Authoritative workflow-source ownership.
6
6
  *
7
- * Markdown and the bounded GitHub-shaped YAML subset are peer authoring
8
- * formats, but one canonical workflow ref must have exactly one source file.
9
- * This module is the shared filesystem arbitration point used before indexing,
10
- * cache reuse, lookup/show, and runtime load/start. It never chooses one
11
- * extension by priority: two recognized siblings are a hard collision.
7
+ * One canonical workflow ref must have exactly one source file. This module
8
+ * is the shared filesystem arbitration point used before indexing, cache
9
+ * reuse, lookup/show, and runtime load/start.
12
10
  */
13
11
  import fs from "node:fs";
14
12
  import path from "node:path";
@@ -29,7 +27,7 @@ export class WorkflowSourceCollisionError extends WorkflowSourceRejectionError {
29
27
  constructor(canonicalName, sourcePaths) {
30
28
  const sorted = [...sourcePaths].sort(compareCodePoints);
31
29
  super(`Workflow "${canonicalName}" resolves to multiple workflow source files: ${sorted.join(", ")}. ` +
32
- "A canonical workflow ref must be owned by exactly one recognized .md or .yml source; remove or rename the duplicate.", "RESOURCE_ALREADY_EXISTS", sorted);
30
+ "A canonical workflow ref must be owned by exactly one recognized .md source; remove or rename the duplicate.", "RESOURCE_ALREADY_EXISTS", sorted);
33
31
  this.name = "WorkflowSourceCollisionError";
34
32
  this.canonicalName = canonicalName;
35
33
  Object.setPrototypeOf(this, new.target.prototype);
@@ -46,15 +44,15 @@ export class WorkflowSourceIdentityError extends UsageError {
46
44
  export class WorkflowSourceNameError extends WorkflowSourceRejectionError {
47
45
  constructor(sourcePath, nestedSuffix) {
48
46
  super(`Workflow source filename ${sourcePath} has an extensionless stem ending in recognized workflow suffix "${nestedSuffix}". ` +
49
- "Nested workflow suffixes are invalid; remove the inner .md or .yml suffix instead of relying on repeated stripping.", "WORKFLOW_SOURCE_INVALID", [sourcePath]);
47
+ "Nested workflow suffixes are invalid; remove the inner .md suffix instead of relying on repeated stripping.", "WORKFLOW_SOURCE_INVALID", [sourcePath]);
50
48
  this.name = "WorkflowSourceNameError";
51
49
  Object.setPrototypeOf(this, new.target.prototype);
52
50
  }
53
51
  }
54
52
  export class WorkflowSourceLinkIdentityError extends WorkflowSourceRejectionError {
55
53
  constructor(sourcePath, targetPath) {
56
- super(`Workflow source ${sourcePath} resolves through a symlink to ${targetPath} with a different source format. ` +
57
- "The authored workflow path and resolved source must use the same .md or .yml format.", "WORKFLOW_SOURCE_INVALID", [sourcePath]);
54
+ super(`Workflow source ${sourcePath} resolves through a symlink to ${targetPath} with a different extension. ` +
55
+ "The authored workflow path and resolved source must both be .md.", "WORKFLOW_SOURCE_INVALID", [sourcePath]);
58
56
  this.name = "WorkflowSourceLinkIdentityError";
59
57
  Object.setPrototypeOf(this, new.target.prototype);
60
58
  }
@@ -240,13 +238,13 @@ function inspectWorkflowSourceDomain(candidates, canonicalName, realRoot) {
240
238
  function pickWorkflowSource(adapterId, canonicalName, sources) {
241
239
  if (sources.length <= 1)
242
240
  return sources[0];
243
- const winner = [...sources].sort((left, right) => left.format === right.format ? 0 : left.format === "markdown" ? -1 : 1)[0];
241
+ const winner = sources[0];
244
242
  const shadowed = sources.filter((source) => source !== winner);
245
243
  const displayName = adapterId === "akm" ? `workflows/${canonicalName}` : canonicalName;
246
- warnOnce(`workflow-source-collision:${displayName}`, `Workflow "${displayName}" has both a .md and .yml source (${shadowed
244
+ warnOnce(`workflow-source-collision:${displayName}`, `Workflow "${displayName}" has several sources (${shadowed
247
245
  .map((source) => source.relativePath)
248
- .join(", ")} shadowed by ${winner?.relativePath}); using the .md source. Remove the shadowed sibling to ` +
249
- "silence this warning.");
246
+ .join(", ")} shadowed by ${winner?.relativePath}); using ${winner?.relativePath}. Remove the shadowed ` +
247
+ "sibling to silence this warning.");
250
248
  return winner;
251
249
  }
252
250
  function inspectWorkflowSourceCandidate(candidate, canonicalName, realRoot) {
@@ -297,7 +295,6 @@ function inspectWorkflowSourceCandidate(candidate, canonicalName, realRoot) {
297
295
  realPath,
298
296
  relativePath: candidate.relativePath,
299
297
  canonicalName,
300
- format: candidate.lowerExtension === ".md" ? "markdown" : "github-yaml",
301
298
  },
302
299
  };
303
300
  }
@@ -321,8 +318,7 @@ export function assertIndexedWorkflowSourceIdentity(ref, indexedPath, authoritat
321
318
  throw new WorkflowSourceIdentityError(ref, indexedPath, authoritative.path);
322
319
  }
323
320
  const indexedExtension = path.extname(indexedPath).toLowerCase();
324
- const authoritativeExtension = authoritative.format === "markdown" ? ".md" : ".yml";
325
- if (indexedExtension !== authoritativeExtension) {
321
+ if (indexedExtension !== ".md") {
326
322
  throw new WorkflowSourceIdentityError(ref, indexedPath, authoritative.path);
327
323
  }
328
324
  }
@@ -1,12 +1,9 @@
1
1
  // This Source Code Form is subject to the terms of the Mozilla Public
2
2
  // License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
- /** Semantic checks shared by the workflow grammars (`parser.ts`, `github-yaml.ts`) and freeze. */
4
+ /** Semantic checks for the Markdown workflow grammar (`parser.ts`). */
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
7
- import { parseBuiltinCommandAction } from "../commands/command/builtin-action.js";
8
- import { classifyTargetRef } from "../execution/target-ref.js";
9
- import { parseSchedule } from "../tasks/schedule.js";
10
7
  export class WorkflowSourceSemanticError extends Error {
11
8
  code;
12
9
  constructor(code, message) {
@@ -15,36 +12,6 @@ export class WorkflowSourceSemanticError extends Error {
15
12
  this.name = "WorkflowSourceSemanticError";
16
13
  }
17
14
  }
18
- /** The argv a `run:` string executes under `shell`. */
19
- export function workflowShellCommand(shell, content) {
20
- if (shell === "cmd")
21
- return ["cmd", "/d", "/s", "/c", content];
22
- if (shell === "pwsh" || shell === "powershell")
23
- return [shell, "-Command", content];
24
- return [shell, "-c", content];
25
- }
26
- export function canonicalizeWorkflowCron(value) {
27
- const canonical = value.trim().split(/\s+/).join(" ");
28
- if (canonical.startsWith("@") || canonical.split(" ").length !== 5) {
29
- throw new WorkflowSourceSemanticError("invalid-cron", "GitHub schedule cron must use exactly five fields.");
30
- }
31
- try {
32
- parseSchedule(canonical, "cron");
33
- }
34
- catch (cause) {
35
- throw new WorkflowSourceSemanticError("invalid-cron", cause instanceof Error ? cause.message : "Invalid cron schedule.");
36
- }
37
- return canonical;
38
- }
39
- export function canonicalizeWorkflowRun(value) {
40
- if (value.includes("${{")) {
41
- throw new WorkflowSourceSemanticError("unsupported-github-expression", "GitHub expressions and contexts are not supported.");
42
- }
43
- if (value.includes("\0")) {
44
- throw new WorkflowSourceSemanticError("invalid-exec-argv", "Local run may not contain NUL bytes.");
45
- }
46
- return value;
47
- }
48
15
  export function canonicalizeWorkflowWorkingDirectory(value, workspaceRoot) {
49
16
  if (hasControlCharacter(value)) {
50
17
  throw new WorkflowSourceSemanticError("working-directory-control-character", "working-directory may not contain NUL or control characters.");
@@ -74,65 +41,6 @@ function hasControlCharacter(value) {
74
41
  }
75
42
  return false;
76
43
  }
77
- export function classifyWorkflowStepUses(value) {
78
- if (value.includes("${{")) {
79
- throw new WorkflowSourceSemanticError("unsupported-github-expression", "GitHub expressions are unsupported in uses.");
80
- }
81
- if (value.length === 0 || value.trim() !== value || /\s/.test(value)) {
82
- throw new WorkflowSourceSemanticError("unsupported-uses-target", "uses must be one exact, non-empty executable ref");
83
- }
84
- if (value === "akm/command")
85
- return { kind: "builtin-command", ref: "akm/command" };
86
- try {
87
- return classifyTargetRef(value);
88
- }
89
- catch (cause) {
90
- throw usesFailure(value, cause);
91
- }
92
- }
93
- /**
94
- * Validate AKM's built-in command action at the shared source/decoder boundary.
95
- *
96
- * Inline YAML actions are portable templates and therefore use WP4's one
97
- * authoritative template validator. Markdown prose is explicitly `literal`,
98
- * while a stored ref remains resolution-owned because its template bytes are
99
- * not available until the later resolver loads the command asset.
100
- */
101
- export function validateWorkflowBuiltinCommand(value, mode) {
102
- let action;
103
- try {
104
- action = parseBuiltinCommandAction(value);
105
- }
106
- catch (cause) {
107
- throw new WorkflowSourceSemanticError("builtin-command-inputs", cause instanceof Error ? cause.message : "Invalid akm/command inputs.");
108
- }
109
- const expectedMode = action.kind === "stored" ? "stored-ref" : "portable-template";
110
- const effectiveMode = mode ?? expectedMode;
111
- if (action.kind === "stored") {
112
- if (effectiveMode !== "stored-ref") {
113
- throw new WorkflowSourceSemanticError("builtin-command-inputs", "Stored akm/command refs require commandMode stored-ref.");
114
- }
115
- return action;
116
- }
117
- if (effectiveMode === "stored-ref") {
118
- throw new WorkflowSourceSemanticError("builtin-command-inputs", "Inline akm/command content cannot use commandMode stored-ref.");
119
- }
120
- if (effectiveMode === "literal" && action.arguments !== undefined) {
121
- throw new WorkflowSourceSemanticError("builtin-command-inputs", "Literal akm/command content cannot declare arguments because no substitution occurs.");
122
- }
123
- return action;
124
- }
125
- function usesFailure(value, cause) {
126
- const message = cause instanceof Error ? cause.message : String(cause);
127
- const code = value.startsWith("docker://")
128
- ? "docker-action-unsupported"
129
- : value.startsWith("./") || value.startsWith("../") || value.startsWith("/")
130
- ? "local-action-path-unsupported"
131
- : /^(?:[A-Za-z0-9][A-Za-z0-9._-]*\/\/)?agents\//.test(value)
132
- ? "non-executable-asset-ref"
133
- : "unsupported-uses-target";
134
- return new WorkflowSourceSemanticError(code, message);
135
- }
136
44
  function verifyPhysicalContainment(workspaceRoot, relative) {
137
45
  let root;
138
46
  try {
package/docs/README.md CHANGED
@@ -6,51 +6,52 @@ start here, then follow links out to the guides, reference, and architecture
6
6
  pages as you need more depth. Each subdirectory also has its own README
7
7
  indexing everything inside it.
8
8
 
9
- Full per-directory indexes: [Guides](https://github.com/itlackey/akm/blob/main/docs/guides/README.md),
10
- [Reference](reference/README.md), [Agents](https://github.com/itlackey/akm/blob/main/docs/agents/README.md),
11
- [Architecture](https://github.com/itlackey/akm/blob/main/docs/architecture/README.md), [Migration](migration/README.md).
9
+ Full per-directory indexes: [Guides](guides/README.md),
10
+ [Reference](reference/README.md), [Agents](agents/README.md),
11
+ [Architecture](architecture/README.md), [Maintainers](maintainers/README.md),
12
+ [Migration](migration/README.md), [Posts](posts/README.md).
12
13
 
13
14
  ## Start
14
15
 
15
- - [Product Surface](https://github.com/itlackey/akm/blob/main/docs/product-surface.md) -- Every feature and its status
16
- - [Getting Started](https://github.com/itlackey/akm/blob/main/docs/guides/getting-started.md) -- Install akm, connect a source, and pull a curated shortlist in five to seven minutes
17
- - [Concepts](https://github.com/itlackey/akm/blob/main/docs/guides/concepts.md) -- Capabilities, bundles, adapters, asset types, and refs -- the mental model in one page
18
- - [Agent Install Guide](https://github.com/itlackey/akm/blob/main/docs/agents/agent-install.md) -- Step-by-step automated (non-interactive) install for agents
19
- - `akm help agents` (short guide by default; `akm help agents --full` for the complete guide) -- The CLI reference agents load to use akm; always the embedded corpus at `src/assets/hints/cli-hints-{full,short}.md`
16
+ - [Product Surface](product-surface.md) -- Every feature and its status
17
+ - [Getting Started](guides/getting-started.md) -- Install akm, connect a source, and pull a curated shortlist in five to seven minutes
18
+ - [Concepts](guides/concepts.md) -- Capabilities, bundles, adapters, asset types, and refs -- the mental model in one page
19
+ - [Agent Install Guide](agents/agent-install.md) -- Step-by-step automated (non-interactive) install for agents
20
+ - `akm hints` (complete guide by default; `akm hints --detail brief` for the short one) -- The CLI reference agents load to use akm; always the embedded corpus at `src/assets/hints/cli-hints-{full,short}.md`
20
21
 
21
22
  ## Use
22
23
 
23
24
  One library for every agent: connect what you already have, load only what
24
25
  the task needs, and capture what you learn along the way.
25
26
 
26
- - [Use AKM With Any Agent](https://github.com/itlackey/akm/blob/main/docs/guides/use-with-any-agent.md) -- Wire akm into Claude Code, OpenCode, Cursor, and other coding assistants with a three-line system prompt block
27
- - [Discover and Load](https://github.com/itlackey/akm/blob/main/docs/guides/discover-and-load.md) -- Search, curate a shortlist, and load exactly the ref a task needs
28
- - [Bundles](https://github.com/itlackey/akm/blob/main/docs/guides/bundles.md) -- Connect local dirs, git repos, npm packages, and websites; browse the registry
29
- - [Capture Knowledge](https://github.com/itlackey/akm/blob/main/docs/guides/capture-knowledge.md) -- `akm remember`, `akm import`, and how captured material becomes available to every agent
30
- - [Wikis](https://github.com/itlackey/akm/blob/main/docs/guides/wikis.md) -- Multi-wiki knowledge bases (Karpathy-style)
31
- - [Environment & Secrets](https://github.com/itlackey/akm/blob/main/docs/reference/env-and-secrets.md) -- `akm env` and `akm secret`: exact operations, file modes, and the security guarantee
32
- - [Run Workflows](https://github.com/itlackey/akm/blob/main/docs/guides/run-workflows.md) -- Start or continue a run, check on it, resume it, or abandon it
33
- - [Scheduling](https://github.com/itlackey/akm/blob/main/docs/guides/scheduling.md) -- Run akm tasks through the OS scheduler (cron / launchd / schtasks) safely
27
+ - [Use AKM With Any Agent](guides/use-with-any-agent.md) -- Wire akm into Claude Code, OpenCode, Cursor, and other coding assistants with a three-line system prompt block
28
+ - [Discover and Load](guides/discover-and-load.md) -- Search, curate a shortlist, and load exactly the ref a task needs
29
+ - [Bundles](guides/bundles.md) -- Connect local dirs, git repos, npm packages, and websites; browse the registry
30
+ - [Capture Knowledge](guides/capture-knowledge.md) -- `akm remember`, `akm import`, and how captured material becomes available to every agent
31
+ - [Wikis](guides/wikis.md) -- Multi-wiki knowledge bases (Karpathy-style)
32
+ - [Environment & Secrets](reference/env-and-secrets.md) -- `akm env` and `akm secret`: exact operations, file modes, and the security guarantee
33
+ - [Run Workflows](guides/run-workflows.md) -- Start or continue a run, check on it, resume it, or abandon it
34
+ - [Scheduling](guides/scheduling.md) -- Run akm tasks through the OS scheduler (cron / launchd / schtasks) safely
34
35
  - [Migrate to 0.9.2](migration/v0.9.1-to-v0.9.2.md) -- Convert task-v2 sources safely and understand workflow resume compatibility
35
- - [Improve the Library](https://github.com/itlackey/akm/blob/main/docs/guides/improve-the-library.md) -- Feedback, history, and proposals -- how evidence turns into reviewable changes
36
- - Recipes: [Turn a Website into a Searchable Bundle](https://github.com/itlackey/akm/blob/main/docs/guides/recipes/website-source.md), [Headless Install](https://github.com/itlackey/akm/blob/main/docs/guides/recipes/headless-install.md)
36
+ - [Improve the Library](guides/improve-the-library.md) -- Feedback, history, and proposals -- how evidence turns into reviewable changes
37
+ - Recipes: [Turn a Website into a Searchable Bundle](guides/recipes/website-source.md), [Headless Install](guides/recipes/headless-install.md)
37
38
 
38
39
  ## Build and operate
39
40
 
40
41
  Package complete capabilities and turn knowledge into repeatable work.
41
42
 
42
- - [Bundle Author's Guide](https://github.com/itlackey/akm/blob/main/docs/guides/author-bundles.md) -- Build a bundle, make it discoverable, and share it so others can install it with `akm bundle add`
43
- - [Author's Guide: Writing Workflows](https://github.com/itlackey/akm/blob/main/docs/guides/author-workflows.md) -- Write and test a workflow definition, from a minimal example to gates and outputs
44
- - [Claude Code workflows vs. akm workflows](https://github.com/itlackey/akm/blob/main/docs/guides/claude-code-vs-akm-workflows.md) -- Short decision guide for choosing between a session-native workflow and an akm workflow ([full technical comparison](https://github.com/itlackey/akm/blob/main/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md))
43
+ - [Bundle Author's Guide](guides/author-bundles.md) -- Build a bundle, make it discoverable, and share it so others can install it with `akm bundle add`
44
+ - [Author's Guide: Writing Workflows](guides/author-workflows.md) -- Write and test a workflow definition, from a minimal example to gates and outputs
45
+ - [Claude Code workflows vs. akm workflows](guides/claude-code-vs-akm-workflows.md) -- Short decision guide for choosing between a session-native workflow and an akm workflow ([full technical comparison](architecture/comparisons/claude-code-vs-akm-workflows-full.md))
45
46
  - [Bundling akm](integration/bundling-akm.md) -- Ship akm inside your own product: the pin/migrate/health boot contract, plan JSON shapes, and exit codes for bundlers
46
47
 
47
48
  ### Maintainers
48
49
 
49
50
  Working on akm itself, not just using it.
50
51
 
51
- - [Maintainer Docs](https://github.com/itlackey/akm/blob/main/docs/maintainers/README.md) -- Start here: local development, measuring improvement, and the curate contract
52
- - [Local Development](https://github.com/itlackey/akm/blob/main/docs/maintainers/local-development.md) -- Dogfooding akm while editing its own source
53
- - [Curate Workmap](https://github.com/itlackey/akm/blob/main/docs/maintainers/curate-workmap.md) -- The current `akm curate` contract and the highest-value next fixes
52
+ - [Maintainer Docs](maintainers/README.md) -- Start here: local development, measuring improvement, and the curate contract
53
+ - [Local Development](maintainers/local-development.md) -- Dogfooding akm while editing its own source
54
+ - [Curate Workmap](maintainers/curate-workmap.md) -- The current `akm curate` contract and the highest-value next fixes
54
55
 
55
56
  ## Look up details
56
57
 
@@ -58,24 +59,24 @@ Working on akm itself, not just using it.
58
59
  - [Configuration](reference/configuration.md) -- Engines, strategies, bundles, and settings
59
60
  - [Supported Formats](reference/supported-formats.md) -- Every bundle format akm recognizes, its detection marker, and current read/write support
60
61
  - [Tasks](reference/tasks.md) -- Task-v3 files, targets, triggers, and fail-closed migration
61
- - [Asset Types](https://github.com/itlackey/akm/blob/main/docs/reference/asset-types.md) -- The capability taxonomy, directory conventions, and per-type examples
62
- - [Refs](https://github.com/itlackey/akm/blob/main/docs/reference/refs.md) -- The ref grammar `akm search` emits and `akm show` consumes
63
- - [Memory](https://github.com/itlackey/akm/blob/main/docs/reference/memory.md) -- The `memory` asset type: capture, belief states, and derived memories
62
+ - [Asset Types](reference/asset-types.md) -- The capability taxonomy, directory conventions, and per-type examples
63
+ - [Refs](reference/refs.md) -- The ref grammar `akm search` emits and `akm show` consumes
64
+ - [Memory](reference/memory.md) -- The `memory` asset type: capture, belief states, and derived memories
64
65
  - [Workflow Schema](reference/workflow-schema.md) -- Authoritative frontmatter/body syntax for a workflow asset
65
66
  - [Workflows (overview)](reference/workflows.md) -- Short map across the workflow schema, engine, and how-to guides
66
- - [Registry](https://github.com/itlackey/akm/blob/main/docs/reference/registry.md) -- Registries, search, hosting, and managing sources
67
- - [Website Sources](https://github.com/itlackey/akm/blob/main/docs/reference/website-sources.md) -- The pluggable fetcher API for URL-based knowledge reads
67
+ - [Registry](reference/registry.md) -- Registries, search, hosting, and managing sources
68
+ - [Website Sources](reference/website-sources.md) -- The pluggable fetcher API for URL-based knowledge reads
68
69
  - [Data & Telemetry](reference/data-and-telemetry.md) -- Exactly what akm reads and writes on your machine (no remote telemetry)
69
- - [Architecture](https://github.com/itlackey/akm/blob/main/docs/architecture/architecture.md) -- How akm's bundles, cache, index, and registries fit together
70
- - [Core Principles](https://github.com/itlackey/akm/blob/main/docs/architecture/akm-core-principles.md) -- Design principles and constraints
71
- - [Adapters](https://github.com/itlackey/akm/blob/main/docs/architecture/adapters.md) -- How akm picks an adapter, indexes, validates, and writes into a bundle
72
- - [The Workflow Engine](https://github.com/itlackey/akm/blob/main/docs/architecture/workflow-engine.md) -- How a frozen plan is stored, dispatched, and resumed without replaying completed units
73
- - [The Improvement Loop](https://github.com/itlackey/akm/blob/main/docs/architecture/improvement.md) -- How a feedback signal becomes a ranking change, and how evidence becomes a proposal
74
- - [Runtime Boundary Design](https://github.com/itlackey/akm/blob/main/docs/architecture/runtime-boundary-design.md) -- Isolating `bun:sqlite`/`Bun.*` from the core
75
- - [Architecture Decision History](https://github.com/itlackey/akm/blob/main/docs/architecture/akm-architecture-decision-history.md) -- ADR-style record of the major architecture rulings
76
- - [Specs](https://github.com/itlackey/akm/blob/main/docs/architecture/README.md#specs-specs) -- Normative specifications (bundle/adapter model, ref grammar, bundle conventions)
77
- - [Internals](https://github.com/itlackey/akm/blob/main/docs/architecture/README.md#internals-internals) -- Current-truth subsystem references (storage, search, indexing, improve, health)
78
- - [Testing](https://github.com/itlackey/akm/blob/main/docs/architecture/README.md#testing-testing) -- Testing workflow and pre-release checklist
70
+ - [Architecture Overview](architecture/architecture.md) -- How akm's bundles, cache, index, and registries fit together
71
+ - [Core Principles](architecture/akm-core-principles.md) -- Design principles and constraints
72
+ - [Adapters](architecture/adapters.md) -- How akm picks an adapter, indexes, validates, and writes into a bundle
73
+ - [The Workflow Engine](architecture/workflow-engine.md) -- How a frozen plan is stored, dispatched, and resumed without replaying completed units
74
+ - [The Improvement Loop](architecture/improvement.md) -- How a feedback signal becomes a ranking change, and how evidence becomes a proposal
75
+ - [Runtime Boundary Design](architecture/runtime-boundary-design.md) -- Isolating `bun:sqlite`/`Bun.*` from the core
76
+ - [Architecture Decision History](architecture/akm-architecture-decision-history.md) -- ADR-style record of the major architecture rulings
77
+ - [Specs](architecture/README.md#specs-specs) -- Normative specifications (bundle/adapter model, ref grammar, bundle conventions)
78
+ - [Internals](architecture/README.md#internals-internals) -- Current-truth subsystem references (storage, search, indexing, improve, health)
79
+ - [Testing](architecture/README.md#testing-testing) -- Testing workflow and pre-release checklist
79
80
  - [Migration](migration/README.md) -- Upgrade guides and per-release migration notes
80
81
  - [Roadmap](https://github.com/itlackey/akm/blob/main/ROADMAP.md) -- High-level focus for the releases from here through 1.0
81
82
 
@@ -85,14 +86,14 @@ AKM retrieves every supported capability type. It directly orchestrates
85
86
  defined execution surfaces such as workflows, agent dispatch, tasks, and
86
87
  guarded subprocess injection. It does not blindly execute arbitrary indexed
87
88
  content merely because that content appears in search results. See
88
- [Core Principles](https://github.com/itlackey/akm/blob/main/docs/architecture/akm-core-principles.md) for the full boundary,
89
- and [The Improvement Loop](https://github.com/itlackey/akm/blob/main/docs/architecture/improvement.md) for how that boundary
89
+ [Core Principles](architecture/akm-core-principles.md) for the full boundary,
90
+ and [The Improvement Loop](architecture/improvement.md) for how that boundary
90
91
  applies to akm's own self-generated changes.
91
92
 
92
93
  ## Posts
93
94
 
94
95
  Source articles for the dev.to publishing pipeline (historical record). See
95
- [docs/posts/README.md](https://github.com/itlackey/akm/blob/main/docs/posts/README.md).
96
+ [posts index](posts/README.md).
96
97
 
97
98
  ## Official Ecosystem Repositories
98
99
 
@@ -0,0 +1,15 @@
1
+ # Agents
2
+
3
+ Documentation for wiring AI agents into akm.
4
+
5
+ Run `akm hints` for the complete CLI reference agents should load into a
6
+ system prompt, or `akm hints --detail brief` for the compact guide.
7
+ It always prints the embedded
8
+ corpus at `src/assets/hints/cli-hints-full.md` / `cli-hints-short.md` --
9
+ browse those files directly if you want to read the reference without running
10
+ the CLI. There used to be a separate `docs/agents/AGENTS.md` /
11
+ `AGENTS.full.md` pair here; it fed nothing at runtime after R-006 and kept
12
+ re-diverging from the embedded copy with no test to catch it, so it was
13
+ deleted and its still-true unique content was merged into the embedded files.
14
+
15
+ - [Agent Install Guide](agent-install.md) -- Short redirect covering the install shape (binary, `akm setup --yes`, a source, an index, `akm hints`); for the exact no-prompts command sequence, see the [headless install recipe](../guides/recipes/headless-install.md)
@@ -0,0 +1,14 @@
1
+ # Agent Install Guide
2
+
3
+ `akm` is a portable capability library agents install and configure without
4
+ interactive prompts: install the binary, run `akm setup --yes`, add a source,
5
+ build the index, then expose `akm hints` output to the agent so it
6
+ knows how to search and load bundle content. Configuration lives in
7
+ top-level keys validated against the config schema, and semantic search can
8
+ run on local embeddings or a remote endpoint depending on what the host
9
+ supports.
10
+
11
+ For the exact command sequence — install, setup, semantic-search
12
+ configuration, adding sources, indexing, verification, and installing agent
13
+ guidance into `AGENTS.md` — see the
14
+ [headless install recipe](../guides/recipes/headless-install.md).