akm-cli 0.9.30 → 0.10.26101001-alpha

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 (353) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/STABILITY.md +79 -53
  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 +13 -27
  9. package/dist/assets/hints/cli-hints-short.md +1 -1
  10. package/dist/assets/improve-strategies/default.json +3 -3
  11. package/dist/assets/prompts/consolidate-pair.md +9 -7
  12. package/dist/cli/shared.js +31 -48
  13. package/dist/cli/unknown-flags.js +6 -43
  14. package/dist/cli.js +8 -34
  15. package/dist/commands/agent/contribute-cli.js +1 -1
  16. package/dist/commands/completions.js +1 -2
  17. package/dist/commands/config-cli.js +5 -28
  18. package/dist/commands/env/env-cli.js +5 -5
  19. package/dist/commands/env/secret-cli.js +2 -2
  20. package/dist/commands/health/checks.js +41 -16
  21. package/dist/commands/health/plugin-staleness.js +52 -22
  22. package/dist/commands/improve/autonomy-gate.js +5 -3
  23. package/dist/commands/improve/consolidate/pair-pass.js +7 -1
  24. package/dist/commands/improve/consolidate.js +6 -35
  25. package/dist/commands/improve/distill/lesson-update.js +91 -0
  26. package/dist/commands/improve/distill-guards.js +1 -43
  27. package/dist/commands/improve/distill.js +140 -20
  28. package/dist/commands/improve/extract-cli.js +1 -1
  29. package/dist/commands/improve/improve-cli.js +120 -114
  30. package/dist/commands/improve/improve-strategies.js +8 -12
  31. package/dist/commands/improve/loop-stages.js +0 -1
  32. package/dist/commands/improve/planner.js +0 -1
  33. package/dist/commands/improve/preparation.js +40 -99
  34. package/dist/commands/improve/proactive-maintenance.js +2 -2
  35. package/dist/commands/improve/reflect-noise.js +3 -55
  36. package/dist/commands/improve/reflect.js +3 -8
  37. package/dist/commands/improve/retrieval-scope.js +2 -2
  38. package/dist/commands/improve/salience.js +2 -9
  39. package/dist/commands/improve/stage.js +14 -9
  40. package/dist/commands/lint/index.js +5 -20
  41. package/dist/commands/observability-cli.js +3 -9
  42. package/dist/commands/proposal/drain.js +39 -6
  43. package/dist/commands/proposal/proposal-cli.js +10 -30
  44. package/dist/commands/proposal/repository.js +3 -3
  45. package/dist/commands/read/knowledge.js +3 -3
  46. package/dist/commands/read/remember-cli.js +0 -13
  47. package/dist/commands/read/search-cli.js +29 -97
  48. package/dist/commands/read/search.js +0 -11
  49. package/dist/commands/read/show.js +0 -19
  50. package/dist/commands/sources/plugin-upgrade.js +164 -101
  51. package/dist/commands/sources/sources-cli.js +1 -15
  52. package/dist/commands/sources/stash-cli.js +4 -12
  53. package/dist/commands/tasks/tasks-cli.js +4 -115
  54. package/dist/commands/workflow/plan.js +11 -33
  55. package/dist/commands/workflow-cli.js +2 -7
  56. package/dist/core/adapter/adapter-ids.js +1 -2
  57. package/dist/core/adapter/adapters/agent-skills-adapter.js +0 -4
  58. package/dist/core/adapter/adapters/akm-adapter.js +9 -48
  59. package/dist/core/adapter/adapters/akm-lint.js +10 -26
  60. package/dist/core/adapter/adapters/akm-metadata.js +2 -72
  61. package/dist/core/adapter/adapters/akm-task-adapter.js +0 -5
  62. package/dist/core/adapter/adapters/akm-workflow-adapter.js +9 -28
  63. package/dist/core/adapter/adapters/dotenv-adapter.js +1 -20
  64. package/dist/core/adapter/adapters/generic-files-adapter.js +0 -10
  65. package/dist/core/adapter/adapters/llm-wiki-adapter.js +0 -4
  66. package/dist/core/adapter/adapters/tool-dir-shared.js +0 -24
  67. package/dist/core/adapter/adapters/website-snapshot-adapter.js +4 -4
  68. package/dist/core/adapter/recognize-match.js +3 -4
  69. package/dist/core/common.js +18 -2
  70. package/dist/core/config/config-schema.js +12 -15
  71. package/dist/core/config/config-types.js +6 -15
  72. package/dist/core/config/config-walker.js +6 -23
  73. package/dist/core/config/config.js +17 -80
  74. package/dist/core/config/engine-semantics.js +7 -3
  75. package/dist/core/config/schema/engines.js +7 -7
  76. package/dist/core/config/schema/improve-processes.js +8 -61
  77. package/dist/core/config/schema/improve.js +2 -21
  78. package/dist/core/config/schema/index-config.js +6 -39
  79. package/dist/core/env-secret-ref.js +2 -45
  80. package/dist/core/errors.js +1 -2
  81. package/dist/core/extra-params.js +2 -86
  82. package/dist/core/file-lock.js +10 -1
  83. package/dist/core/improve-result.js +11 -1
  84. package/dist/core/mutation-target.js +2 -2
  85. package/dist/core/recognition-util.js +4 -5
  86. package/dist/core/warn.js +21 -4
  87. package/dist/core/write-source.js +3 -3
  88. package/dist/execution/target-ref.js +1 -2
  89. package/dist/indexer/search/db-search.js +4 -19
  90. package/dist/indexer/search/fts-query.js +0 -19
  91. package/dist/integrations/agent/engine-resolution.js +5 -2
  92. package/dist/integrations/agent/index.js +1 -1
  93. package/dist/integrations/agent/profiles.js +41 -98
  94. package/dist/integrations/agent/request-lowering.js +3 -3
  95. package/dist/integrations/harnesses/aider/index.js +5 -0
  96. package/dist/integrations/harnesses/amazonq/index.js +1 -0
  97. package/dist/integrations/harnesses/claude/config-import.js +2 -3
  98. package/dist/integrations/harnesses/claude/index.js +5 -0
  99. package/dist/integrations/harnesses/codex/index.js +1 -0
  100. package/dist/integrations/harnesses/copilot/index.js +1 -0
  101. package/dist/integrations/harnesses/gemini/index.js +1 -0
  102. package/dist/integrations/harnesses/index.js +18 -39
  103. package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
  104. package/dist/integrations/harnesses/opencode/config-import.js +121 -52
  105. package/dist/integrations/harnesses/opencode/index.js +22 -0
  106. package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
  107. package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
  108. package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
  109. package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
  110. package/dist/integrations/harnesses/opencode/session-log.js +104 -115
  111. package/dist/integrations/harnesses/opencode/version.js +98 -0
  112. package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
  113. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
  114. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
  115. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +228 -0
  116. package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
  117. package/dist/integrations/harnesses/openhands/index.js +1 -0
  118. package/dist/integrations/harnesses/pi/index.js +1 -0
  119. package/dist/integrations/harnesses/shared.js +2 -0
  120. package/dist/integrations/harnesses/types.js +2 -0
  121. package/dist/llm/client.js +74 -14
  122. package/dist/output/cli-hints.js +1 -1
  123. package/dist/output/context.js +10 -19
  124. package/dist/output/format-exempt.js +5 -8
  125. package/dist/output/shapes/helpers.js +1 -22
  126. package/dist/output/shapes/passthrough.js +0 -1
  127. package/dist/output/shapes.js +3 -31
  128. package/dist/output/stdout.js +5 -1
  129. package/dist/output/text/command-format.js +6 -1
  130. package/dist/output/text/workflow-format.js +4 -22
  131. package/dist/scripts/akm-migrate-node.js +15746 -16706
  132. package/dist/scripts/akm-migrate.js +16319 -17275
  133. package/dist/setup/detect.js +10 -4
  134. package/dist/setup/harness-config-import.js +5 -14
  135. package/dist/setup/setup.js +1 -1
  136. package/dist/setup/steps/tasks.js +12 -13
  137. package/dist/storage/repositories/task-history-repository.js +0 -5
  138. package/dist/storage/repositories/workflow-runs-repository.js +5 -15
  139. package/dist/tasks/embedded.js +2 -1
  140. package/dist/tasks/run/task-history.js +0 -2
  141. package/dist/tasks/schedule-gates.js +39 -0
  142. package/dist/tasks/scheduler-binding.js +0 -16
  143. package/dist/tasks/scheduler-sync.js +3 -97
  144. package/dist/tasks/source/bounded-document.js +1 -1
  145. package/dist/tasks/source/task-source-v4.js +2 -12
  146. package/dist/tasks/task-run-reserved-flags.js +2 -31
  147. package/dist/workflows/authoring/authoring.js +6 -6
  148. package/dist/workflows/compile.js +8 -65
  149. package/dist/workflows/exec/child-workflow.js +22 -3
  150. package/dist/workflows/exec/native-executor.js +12 -147
  151. package/dist/workflows/exec/run-workflow.js +31 -103
  152. package/dist/workflows/exec/step-work.js +9 -178
  153. package/dist/workflows/exec/unit-dispatch.js +0 -10
  154. package/dist/workflows/freeze/environment.js +3 -44
  155. package/dist/workflows/freeze/freeze.js +8 -41
  156. package/dist/workflows/freeze/targets/child-workflow.js +27 -63
  157. package/dist/workflows/freeze/targets/command.js +2 -16
  158. package/dist/workflows/freeze/targets/shell.js +0 -2
  159. package/dist/workflows/freeze/task-bindings.js +2 -28
  160. package/dist/workflows/ir/params.js +12 -2
  161. package/dist/workflows/parser.js +82 -232
  162. package/dist/workflows/plan.js +1 -1
  163. package/dist/workflows/renderer.js +10 -19
  164. package/dist/workflows/runtime/run-plan.js +11 -53
  165. package/dist/workflows/runtime/runs.js +4 -27
  166. package/dist/workflows/source-files.js +12 -16
  167. package/dist/workflows/source-semantics.js +1 -93
  168. package/docs/README.md +43 -42
  169. package/docs/agents/README.md +15 -0
  170. package/docs/agents/agent-install.md +14 -0
  171. package/docs/architecture/README.md +67 -0
  172. package/docs/architecture/adapters.md +258 -0
  173. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  174. package/docs/architecture/akm-core-principles.md +126 -0
  175. package/docs/architecture/architecture.md +578 -0
  176. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  177. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  178. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  179. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  180. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  181. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  182. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  183. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  184. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  185. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  186. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  187. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  188. package/docs/architecture/decisions/README.md +62 -0
  189. package/docs/architecture/improvement.md +471 -0
  190. package/docs/architecture/internals/classification.md +154 -0
  191. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  192. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  193. package/docs/architecture/internals/health-advisories.md +110 -0
  194. package/docs/architecture/internals/improve-workflow.md +720 -0
  195. package/docs/architecture/internals/indexing.md +498 -0
  196. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  197. package/docs/architecture/internals/search.md +248 -0
  198. package/docs/architecture/internals/storage-locations.md +943 -0
  199. package/docs/architecture/persisted-data-compat.md +68 -0
  200. package/docs/architecture/reviews/env-secret-access.md +319 -0
  201. package/docs/architecture/runtime-boundary-design.md +153 -0
  202. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  203. package/docs/architecture/specs/0.9.0-decisions.md +532 -0
  204. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  205. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  206. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  207. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  208. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  209. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  210. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  211. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  212. package/docs/architecture/specs/di-seams-plan.md +539 -0
  213. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  214. package/docs/architecture/specs/fact-asset-type.md +142 -0
  215. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  216. package/docs/architecture/specs/okf-support.md +148 -0
  217. package/docs/architecture/specs/ref.md +329 -0
  218. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  219. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  220. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  221. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  222. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  223. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  224. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  225. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  226. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  227. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  228. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  229. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  230. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  231. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  232. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  233. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  234. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  235. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  236. package/docs/architecture/specs/workflow-format-unification.md +432 -0
  237. package/docs/architecture/testing/manual-testing-checklist.md +3411 -0
  238. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  239. package/docs/architecture/testing/task-workflow-manual-tests.md +1720 -0
  240. package/docs/architecture/testing/testing-workflow.md +446 -0
  241. package/docs/architecture/workflow-engine.md +223 -0
  242. package/docs/guides/README.md +33 -0
  243. package/docs/guides/author-bundles.md +310 -0
  244. package/docs/guides/author-workflows.md +490 -0
  245. package/docs/guides/bundles.md +321 -0
  246. package/docs/guides/capture-knowledge.md +136 -0
  247. package/docs/guides/claude-code-vs-akm-workflows.md +29 -0
  248. package/docs/guides/concepts.md +93 -0
  249. package/docs/guides/discover-and-load.md +158 -0
  250. package/docs/guides/getting-started.md +240 -0
  251. package/docs/guides/improve-the-library.md +246 -0
  252. package/docs/guides/knowledge-management.md +18 -0
  253. package/docs/guides/recipes/headless-install.md +97 -0
  254. package/docs/guides/recipes/website-source.md +28 -0
  255. package/docs/guides/run-workflows.md +279 -0
  256. package/docs/guides/scheduling.md +123 -0
  257. package/docs/guides/use-with-any-agent.md +174 -0
  258. package/docs/guides/wikis.md +81 -0
  259. package/docs/integration/bundling-akm.md +7 -6
  260. package/docs/maintainers/README.md +19 -0
  261. package/docs/maintainers/curate-workmap.md +335 -0
  262. package/docs/maintainers/eval.md +3 -0
  263. package/docs/maintainers/local-development.md +108 -0
  264. package/docs/maintainers/release-checklist.md +132 -0
  265. package/docs/migration/README.md +2 -2
  266. package/docs/migration/release-notes/0.0.13.md +1 -1
  267. package/docs/migration/release-notes/0.1.0.md +1 -1
  268. package/docs/migration/release-notes/0.2.0.md +1 -1
  269. package/docs/migration/release-notes/0.3.0.md +1 -1
  270. package/docs/migration/release-notes/0.5.0.md +1 -1
  271. package/docs/migration/release-notes/0.6.0.md +1 -1
  272. package/docs/migration/release-notes/0.7.0.md +1 -1
  273. package/docs/migration/release-notes/0.7.3.md +2 -2
  274. package/docs/migration/release-notes/0.7.4.md +1 -1
  275. package/docs/migration/release-notes/0.7.5.md +1 -1
  276. package/docs/migration/release-notes/0.8.0.md +1 -1
  277. package/docs/migration/release-notes/0.9.0.md +1 -1
  278. package/docs/migration/release-notes/0.9.14.md +1 -1
  279. package/docs/migration/release-notes/0.9.15.md +1 -1
  280. package/docs/migration/release-notes/0.9.16.md +1 -1
  281. package/docs/migration/release-notes/0.9.17.md +1 -1
  282. package/docs/migration/release-notes/0.9.19.md +1 -1
  283. package/docs/migration/release-notes/0.9.2.md +1 -1
  284. package/docs/migration/release-notes/README.md +27 -31
  285. package/docs/migration/v0.5-to-v0.6.md +759 -0
  286. package/docs/migration/v0.8-to-v0.9.md +1 -1
  287. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  288. package/docs/posts/README.md +30 -0
  289. package/docs/posts/akm-command-tour.md +495 -0
  290. package/docs/posts/akm-logo-sized.webp +0 -0
  291. package/docs/posts/belief-aware-memory-12.md +139 -0
  292. package/docs/posts/config-v2-lessons-16.md +191 -0
  293. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  294. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  295. package/docs/posts/intro-part-01.md +76 -0
  296. package/docs/posts/intro-part-02.md +221 -0
  297. package/docs/posts/intro-part-03.md +190 -0
  298. package/docs/posts/intro-part-04.md +221 -0
  299. package/docs/posts/llm-mode-reflect-13.md +166 -0
  300. package/docs/posts/openpalm-built-on-akm.md +86 -0
  301. package/docs/posts/progressive-disclosure-06.md +129 -0
  302. package/docs/posts/proposal-safety-net-15.md +112 -0
  303. package/docs/posts/release-0.5.0.md +247 -0
  304. package/docs/posts/release-0.6.0.md +117 -0
  305. package/docs/posts/release-0.7.0.md +159 -0
  306. package/docs/posts/release-0.8.0.md +332 -0
  307. package/docs/posts/scattered-skills-05.md +100 -0
  308. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  309. package/docs/posts/team-skills-07.md +198 -0
  310. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  311. package/docs/posts/workflows-vaults-09.md +321 -0
  312. package/docs/product-surface.md +54 -0
  313. package/docs/reference/README.md +2 -2
  314. package/docs/reference/api.md +65 -0
  315. package/docs/reference/asset-types.md +166 -0
  316. package/docs/reference/bundle-types.md +2 -4
  317. package/docs/reference/cli.md +129 -175
  318. package/docs/reference/configuration.md +84 -19
  319. package/docs/reference/data-and-telemetry.md +1 -1
  320. package/docs/reference/env-and-secrets.md +126 -0
  321. package/docs/reference/memory.md +124 -0
  322. package/docs/reference/refs.md +156 -0
  323. package/docs/reference/registry.md +489 -0
  324. package/docs/reference/supported-formats.md +3 -4
  325. package/docs/reference/tasks.md +12 -19
  326. package/docs/reference/website-sources.md +141 -0
  327. package/docs/reference/workflow-schema.md +89 -317
  328. package/docs/reference/workflows.md +20 -48
  329. package/package.json +23 -16
  330. package/schemas/akm-config.json +2 -243
  331. package/schemas/akm-task.json +2 -3
  332. package/schemas/akm-workflow.json +47 -84
  333. package/dist/assets/improve-strategies/catchup.json +0 -41
  334. package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
  335. package/dist/assets/improve-strategies/quick.json +0 -17
  336. package/dist/assets/improve-strategies/reflect-distill.json +0 -29
  337. package/dist/assets/improve-strategies/thorough.json +0 -49
  338. package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
  339. package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
  340. package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
  341. package/dist/cli/retired-commands.js +0 -118
  342. package/dist/commands/tasks/validate.js +0 -176
  343. package/dist/core/config/legacy-source-shape-shim.js +0 -117
  344. package/dist/integrations/harnesses/ids.js +0 -28
  345. package/dist/tasks/source/task-source-v3-frozen.js +0 -424
  346. package/dist/tasks/source/task-to-v4.js +0 -863
  347. package/dist/workflows/exec/worktree.js +0 -372
  348. package/dist/workflows/freeze/child-output-references.js +0 -83
  349. package/dist/workflows/freeze/identity.js +0 -22
  350. package/dist/workflows/freeze/targets/script.js +0 -50
  351. package/dist/workflows/freeze/targets/task.js +0 -124
  352. package/dist/workflows/github-yaml.js +0 -506
  353. package/dist/workflows/runtime/run-outputs.js +0 -80
@@ -0,0 +1,759 @@
1
+ # Migrating from akm 0.5.x to 0.6.0
2
+
3
+ > **Also see the [archived pre-1.0 plan](https://github.com/itlackey/akm/blob/be3a6a632b0cbe7a63ce71b7d093d8ac266e857c/docs/archive/pre-1.0-migration.md).** The architecture refactor landed mid-0.6
4
+ > cycle. It removes the `openviking` source provider, renames the config key
5
+ > `stashes[]` to `sources[]` (auto-migrated in memory), adds the
6
+ > `writable` and `defaultWriteTarget` fields, and treats Context Hub as a
7
+ > regular git repo. If you are on 0.5.x and upgrading to a current 0.6.x
8
+ > build, read both this file and the archived plan.
9
+
10
+ This guide covers everything you need to know to upgrade from akm 0.5.x to
11
+ 0.6.0. Most projects will work without changes thanks to automatic on-disk
12
+ migrations; a small number of config fields and CLI flags require manual
13
+ updates.
14
+
15
+ If you only want a one-line summary of breaking changes, run:
16
+
17
+ ```sh
18
+ akm help migrate 0.6.0
19
+ ```
20
+
21
+ That command prints the same content you are reading here, sourced directly
22
+ from `CHANGELOG.md` and the release notes embedded in this document.
23
+
24
+ ## Table of contents
25
+
26
+ - [Installing 0.6.0](#installing-060)
27
+ - [What changed in 0.6.0](#what-changed-in-060)
28
+ - [Automatic migrations (no action required)](#automatic-migrations-no-action-required)
29
+ - [Manual actions required](#manual-actions-required)
30
+ - [Wire format change: `kits[]` → `stashes[]`](#wire-format-change-kits--stashes)
31
+ - [Registry index schema v3](#registry-index-schema-v3)
32
+ - [Publisher / kit-maker changes](#publisher--kit-maker-changes)
33
+ - [Sibling repositories](#sibling-repositories)
34
+ - [New in 0.6.0 (bonus features)](#new-in-060-bonus-features)
35
+ - [Internal types and file renames (developers only)](#internal-types-and-file-renames-developers-only)
36
+ - [Removed without replacement](#removed-without-replacement)
37
+ - [Verifying the upgrade](#verifying-the-upgrade)
38
+ - [Troubleshooting](#troubleshooting)
39
+ - [Rolling back](#rolling-back)
40
+
41
+ ## Installing 0.6.0
42
+
43
+ Pick whichever install method you used for 0.5.x:
44
+
45
+ ```sh
46
+ # npm
47
+ npm install -g akm-cli@0.6.0
48
+
49
+ # bun
50
+ bun install -g akm-cli@0.6.0
51
+
52
+ # From source (contributors)
53
+ git fetch origin && git checkout v0.6.0 && bun install
54
+ ```
55
+
56
+ If you installed via `akm upgrade` on 0.5.x, you can use it again on
57
+ 0.6.0 — the command re-runs the same underlying package install:
58
+
59
+ ```sh
60
+ akm upgrade
61
+ ```
62
+
63
+ The upgrade itself does **not** touch your stash files, your
64
+ `config.json`, or your registry index. Automatic migrations run the
65
+ first time a 0.6.0 command reads them. See
66
+ [Automatic migrations](#automatic-migrations-no-action-required) for the
67
+ exact list.
68
+
69
+ ## What changed in 0.6.0
70
+
71
+ 0.6.0 unifies the runtime domain model around two concepts: **stashes**
72
+ (any source of content akm can read) and **registries** (services that help
73
+ you discover stashes). Several historical layers — "kits" as a runtime
74
+ concept, the parallel `installed[]` config array, the special-cased
75
+ `context-hub` provider type — are removed in favour of that simpler model.
76
+
77
+ First run after upgrade triggers a full `index.db` rebuild because
78
+ `DB_VERSION` was bumped 8 → 9 to add the `workflow_documents` table. The
79
+ next `akm index` repopulates everything; `workflow.db` (run state) is
80
+ unaffected.
81
+
82
+ The high-level changes:
83
+
84
+ | Area | 0.5.x | 0.6.0 |
85
+ | --- | --- | --- |
86
+ | Wire format used by registries | `kits[]` | `stashes[]` |
87
+ | Discovery keyword / topic | `akm-kit` | `akm-stash` |
88
+ | Registry index schema | v2 (with `kits[]`) | v3 (with `stashes[]`) |
89
+ | Runtime domain noun | "source" / "kit" / "stash" | **stash** (one term) |
90
+ | Provider types | `filesystem`, `git`, `openviking`, `context-hub` (special-cased) | `filesystem`, `git`, `openviking` (only) |
91
+ | Stash source kinds (`StashSource["type"]`) | `local`, `npm`, `github`, `git`, `website` | `filesystem`, `git`, `npm`, `github`, `website`, `openviking` |
92
+ | Lock file | `stash.lock` | `akm.lock` |
93
+ | `installed[]` in `config.json` | user-facing | machine-managed in `akm.lock` |
94
+ | `stashDir` top-level field | required for primary stash | deprecated; use `primary: true` on a stash entry |
95
+ | `disableGlobalStashes` | boolean | replaced by `stashInheritance: "merge" \| "replace"` |
96
+ | `--for-agent` flag | top-level flag | deprecated; use `--detail=agent` |
97
+ | `akm enable context-hub` | hardcoded toggle | removed; add as a regular git stash |
98
+
99
+ Each of these is covered in detail below.
100
+
101
+ ## Automatic migrations (no action required)
102
+
103
+ These migrations happen silently on first run of v0.6.0. None of them lose
104
+ data; all of them are idempotent.
105
+
106
+ ### 1. `stash.lock` → `akm.lock`
107
+
108
+ If `~/.config/akm/stash.lock` (or the equivalent path under `AKM_CONFIG_DIR`)
109
+ exists and `akm.lock` does not, akm renames it on startup. The first command
110
+ you run in 0.6.0 will perform the rename and then proceed normally.
111
+
112
+ If both files exist, akm prefers `akm.lock` and leaves the old `stash.lock`
113
+ in place untouched. You can delete `stash.lock` manually after confirming
114
+ your config is healthy with `akm info`.
115
+
116
+ ### 2. `installed[]` → `stashes[]` + `akm.lock`
117
+
118
+ Every entry in `config.installed[]` is mapped to a `StashEntry` record in
119
+ `config.stashes[]`, and its lock data (resolved version, cache directory,
120
+ install timestamp) is written to `akm.lock`. The `installed[]` field is
121
+ removed from `config.json` the next time akm writes it (for example, after
122
+ `akm config set …` or `akm add …`).
123
+
124
+ The mapping uses these rules:
125
+
126
+ | `installed[]` field | New location |
127
+ | --- | --- |
128
+ | `id` | `stashes[].name` (also kept as `stashes[].id` for compatibility) |
129
+ | `source` (`npm` / `github` / `git` / `local`) | `stashes[].source.type` |
130
+ | `ref` | `stashes[].source.ref` |
131
+ | `installRef` | `stashes[].source.ref` (resolved form) |
132
+ | `installedAt` / `version` / `cachePath` | `akm.lock.stashes[<name>]` |
133
+
134
+ Until your `config.json` is rewritten, both representations are read at
135
+ startup.
136
+
137
+ ### 3. `stashDir` → `primary: true`
138
+
139
+ The top-level `stashDir` field is still read for backwards compatibility. At
140
+ load time, akm synthesizes a primary stash entry equivalent to:
141
+
142
+ ```json
143
+ {
144
+ "name": "primary",
145
+ "type": "filesystem",
146
+ "primary": true,
147
+ "source": { "type": "filesystem", "path": "<stashDir>" }
148
+ }
149
+ ```
150
+
151
+ No on-disk rewrite happens automatically. The field is rewritten only when
152
+ you next run `akm config set …` against any other field.
153
+
154
+ ### 4. Type alias normalization
155
+
156
+ Stash entries with `type: "context-hub"` or `type: "github"` are loaded as
157
+ `type: "git"` in memory. `akm config list` will show the normalized form.
158
+ Update your config files to use `"git"` directly (and the `source.type` in
159
+ the discriminated union) to remove the migration step on future runs.
160
+
161
+ | Alias on disk | Normalized to |
162
+ | --- | --- |
163
+ | `"context-hub"` | `"git"` |
164
+ | `"github"` (as a stash type, not a source locator) | `"git"` |
165
+
166
+ The locator forms `github:owner/repo` and `git+https://…` passed to
167
+ `akm add` are unaffected — they continue to mean what they always have.
168
+
169
+ ## Manual actions required
170
+
171
+ The following items are not auto-migrated. They are small in scope but must
172
+ be applied to keep your scripts and project configs working.
173
+
174
+ ### 1. Replace `disableGlobalStashes`
175
+
176
+ If your project `.akm/config.json` (or user config) contains:
177
+
178
+ ```json
179
+ { "disableGlobalStashes": true }
180
+ ```
181
+
182
+ Replace it with:
183
+
184
+ ```json
185
+ { "stashInheritance": "replace" }
186
+ ```
187
+
188
+ `stashInheritance` accepts two values:
189
+
190
+ | Value | Meaning |
191
+ | --- | --- |
192
+ | `"merge"` (default) | Project stashes are appended after user-level stashes |
193
+ | `"replace"` | Project stashes replace user-level stashes entirely |
194
+
195
+ This is a strict superset of the old behavior — `disableGlobalStashes: true`
196
+ maps exactly to `stashInheritance: "replace"`.
197
+
198
+ ### 2. Replace `--for-agent` with `--detail=agent`
199
+
200
+ In scripts, aliases, or agent prompts that use the `--for-agent` flag:
201
+
202
+ ```sh
203
+ # Before
204
+ akm search "deployment" --for-agent # doclint:ignore (pre-0.7.0 flag, this is the "Before" side of the migration)
205
+ akm show script:deploy.sh --for-agent # doclint:ignore (pre-0.7.0 flag, this is the "Before" side of the migration)
206
+
207
+ # After
208
+ akm search "deployment" --detail=agent
209
+ akm show script:deploy.sh --detail=agent
210
+ ```
211
+
212
+ `--for-agent` is still accepted in 0.6.0 but emits a deprecation warning to
213
+ stderr. It will be removed in 0.7.0.
214
+
215
+ ### 3. Replace `akm enable context-hub` / `akm disable context-hub`
216
+
217
+ context-hub is no longer a special-cased provider. It is just a git
218
+ repository like any other. The hardcoded enable/disable toggles are removed.
219
+
220
+ ```sh
221
+ # Before
222
+ akm enable context-hub # doclint:ignore (pre-0.6.0 command, this is the "Before" side of the migration)
223
+ akm disable context-hub # doclint:ignore (pre-0.6.0 command, this is the "Before" side of the migration)
224
+
225
+ # After — add it explicitly if you want it
226
+ akm add github:andrewyng/context-hub --name context-hub # doclint:ignore (historical — pre-0.9.0 command spelling)
227
+
228
+ # To temporarily disable without removing
229
+ # Edit your config.json and set "enabled": false on the stash entry
230
+ ```
231
+
232
+ The generalized commands `akm registry enable/disable <name>` and
233
+ `akm stash enable/disable <name>` are now available for toggling any
234
+ configured registry or stash by name. See [CLI Reference](../reference/cli.md) for the
235
+ full syntax.
236
+
237
+ ### 4. Update `akm list` parsing in scripts
238
+
239
+ The single tri-state `kind` field (`"local" | "managed" | "remote"`) in
240
+ `akm list --format json` output is replaced by two orthogonal fields:
241
+
242
+ | Field | Values | Meaning |
243
+ | --- | --- | --- |
244
+ | `origin` | `"local"`, `"remote"` | Where the content comes from |
245
+ | `access` | `"indexed"`, `"live"` | How akm queries it |
246
+
247
+ The old combinations map cleanly to the new ones:
248
+
249
+ | Old `kind` | New `origin` | New `access` |
250
+ | --- | --- | --- |
251
+ | `"local"` | `"local"` | `"indexed"` |
252
+ | `"managed"` | `"remote"` | `"indexed"` |
253
+ | `"remote"` | `"remote"` | `"live"` |
254
+
255
+ ```sh
256
+ # Before — checking for managed kits
257
+ akm list --format json | jq '.[] | select(.kind == "managed")' # doclint:ignore (historical — pre-0.9.0 command spelling)
258
+
259
+ # After — checking for remote indexed stashes
260
+ akm list --format json | jq '.[] | select(.origin == "remote" and .access == "indexed")' # doclint:ignore (historical — pre-0.9.0 command spelling)
261
+ ```
262
+
263
+ The `--kind` filter on `akm list` is replaced by `--origin` and `--access`.
264
+ For backward compatibility during 0.6.x, `--kind <legacy-value>` is still
265
+ accepted and translated to the new pair.
266
+
267
+ ### 5. Handle new error codes in automated scripts
268
+
269
+ Error JSON now includes a machine-readable `code` field on every failure:
270
+
271
+ ```json
272
+ { "ok": false, "error": "Stash not found: foo", "code": "STASH_NOT_FOUND", "hint": "Run `akm list` to see configured stashes." }
273
+ ```
274
+
275
+ Scripts that previously parsed error messages by string matching should
276
+ switch to `code` comparisons. The full code list is documented in the
277
+ [CLI Reference](../reference/cli.md#exit-codes-and-error-envelope).
278
+
279
+ Common codes you can rely on:
280
+
281
+ | Code | Meaning |
282
+ | --- | --- |
283
+ | `STASH_NOT_FOUND` | Named stash does not exist in config |
284
+ | `STASH_DUPLICATE` | A stash with that name is already configured |
285
+ | `REGISTRY_NOT_FOUND` | Named registry does not exist in config |
286
+ | `ASSET_NOT_FOUND` | `akm show <ref>` could not resolve the ref |
287
+ | `INSTALL_AUDIT_BLOCKED` | Install was blocked by the security audit |
288
+ | `CONFIG_INVALID` | Config file failed validation |
289
+ | `USAGE` | The CLI was invoked with bad flags or arguments |
290
+
291
+ ## Wire format change: `kits[]` → `stashes[]`
292
+
293
+ The wire format that registries publish, and that the akm CLI consumes
294
+ when searching a registry, has been renamed from `kits[]` to `stashes[]`.
295
+ This is a clean break — there is **no** transparent fallback. `akm-cli >=
296
+ 0.6.0` only parses the v3 schema.
297
+
298
+ **Before** (v2 index, parsed by 0.5.x):
299
+
300
+ ```json
301
+ {
302
+ "version": 2,
303
+ "updatedAt": "2026-04-01T00:00:00Z",
304
+ "kits": [
305
+ {
306
+ "id": "npm:@scope/my-kit",
307
+ "name": "my-kit",
308
+ "description": "Deployment scripts and skills",
309
+ "ref": "@scope/my-kit",
310
+ "source": "npm",
311
+ "tags": ["deploy"],
312
+ "assetTypes": ["script", "skill"]
313
+ }
314
+ ]
315
+ }
316
+ ```
317
+
318
+ **After** (v3 index, parsed by 0.6.x):
319
+
320
+ ```json
321
+ {
322
+ "version": 3,
323
+ "updatedAt": "2026-04-23T00:00:00Z",
324
+ "stashes": [
325
+ {
326
+ "id": "npm:@scope/my-kit",
327
+ "name": "my-kit",
328
+ "description": "Deployment scripts and skills",
329
+ "tags": ["deploy"],
330
+ "assetTypes": ["script", "skill"],
331
+ "stash": {
332
+ "name": "my-kit",
333
+ "type": "npm",
334
+ "source": { "type": "npm", "ref": "@scope/my-kit" }
335
+ }
336
+ }
337
+ ]
338
+ }
339
+ ```
340
+
341
+ The new `stash` property carries a `Partial<StashEntry>` draft. `akm add
342
+ <registry-hit-id>` takes that draft, fills in defaults (notably `name` if
343
+ not provided), and writes it directly into your `config.stashes[]`. This
344
+ removes the parallel `source` / `ref` / `installRef` fields that previously
345
+ had to be reassembled by the CLI.
346
+
347
+ The old `source` / `ref` / `installRef` fields **may** appear on a v3 entry
348
+ and are accepted for one version cycle as deprecated read-only fallbacks.
349
+ They will be removed in v4. Index generators should write only the new
350
+ `stash` field going forward.
351
+
352
+ ## Registry index schema v3
353
+
354
+ The schema previously shipped as `registry-index.schema.json` (removed from
355
+ the repository since; the highlights below still describe the v3 structure it
356
+ covered). Highlights:
357
+
358
+ - `version` enum is `[1, 2, 3]`. `akm-cli >= 0.6.0` parses only `version: 3`.
359
+ - The top-level array is `stashes[]` (was `kits[]`).
360
+ - Each entry carries a `stash: Partial<StashEntry>` draft.
361
+ - A new `$defs.StashSource` definition describes the discriminated union
362
+ used by `stash.source`.
363
+ - The legacy `source` / `ref` / `installRef` fields are present but marked
364
+ `deprecated: true` for one version cycle.
365
+
366
+ ### Migrating a self-hosted registry
367
+
368
+ If you publish your own registry index, follow these steps:
369
+
370
+ 1. **Bump `version` to `3`.** akm 0.6.0 will refuse to load `version: 1` or
371
+ `version: 2` indexes and report `REGISTRY_INDEX_INCOMPATIBLE`.
372
+ 2. **Rename `kits` to `stashes`.** A simple JSON rewrite is sufficient.
373
+ 3. **Add the `stash` draft to each entry.** For an npm package:
374
+ ```json
375
+ "stash": {
376
+ "name": "my-kit",
377
+ "type": "npm",
378
+ "source": { "type": "npm", "ref": "@scope/my-kit" }
379
+ }
380
+ ```
381
+ For a GitHub repo:
382
+ ```json
383
+ "stash": {
384
+ "name": "my-kit",
385
+ "type": "git",
386
+ "source": { "type": "git", "url": "https://github.com/owner/repo", "ref": "main" }
387
+ }
388
+ ```
389
+ 4. **Optionally remove the legacy `source` / `ref` / `installRef` fields.**
390
+ They are deprecated in v3 and will be removed in v4. Keeping them does
391
+ not hurt during the 0.6.x window if you have older clients to support.
392
+ 5. **Republish.** akm 0.6.x clients will pick up the new index on their
393
+ next refresh (1-hour TTL for `static-index` providers).
394
+
395
+ If you generate your index with the akm repository's index builder
396
+ (`scripts/build-registry-index.ts`, formerly the `akm registry build-index`
397
+ subcommand), upgrading to 0.6.0 is sufficient — the generator emits v3 by
398
+ default.
399
+
400
+ For a hand-rolled v1/v2 index, the migration is a small mechanical rewrite:
401
+ rename the top-level `kits` array to `stashes`, set `version` to `3`, and
402
+ republish. A scripted helper (e.g. `jq` one-liner) is enough:
403
+
404
+ ```sh
405
+ jq '{version: 3, updatedAt, stashes: .kits}' old-index.json > new-index.json
406
+ ```
407
+
408
+ ## Publisher / kit-maker changes
409
+
410
+ If you publish a kit (npm package or GitHub repo) and want it to be
411
+ discoverable through registry search, the keyword / topic has changed.
412
+
413
+ ### npm packages
414
+
415
+ Update `keywords` in your `package.json`:
416
+
417
+ ```diff
418
+ {
419
+ "name": "@you/my-kit",
420
+ "version": "1.0.0",
421
+ - "keywords": ["akm-kit"]
422
+ + "keywords": ["akm-stash"]
423
+ }
424
+ ```
425
+
426
+ For maximum compatibility during the transition, you can include both:
427
+
428
+ ```json
429
+ { "keywords": ["akm-stash", "akm-kit"] }
430
+ ```
431
+
432
+ `akm-cli >= 0.6.0` discovers packages tagged with `akm-stash`. The legacy
433
+ `akm-kit` keyword is no longer queried by the CLI and existing registry
434
+ build pipelines should switch to the new keyword. Older 0.5.x clients
435
+ that have not upgraded will only see your package if you also keep
436
+ `akm-kit` in your keywords list — drop it once your audience has moved.
437
+
438
+ ### GitHub repositories
439
+
440
+ Update the repo topic:
441
+
442
+ ```sh
443
+ gh repo edit --add-topic akm-stash
444
+ gh repo edit --remove-topic akm-kit # optional, after the transition
445
+ ```
446
+
447
+ Or update topics from the repository **About** sidebar in the GitHub web
448
+ UI.
449
+
450
+ ### `package.json` `akm.include` and friends
451
+
452
+ The `akm.include` array and other publish-time `package.json` fields are
453
+ unchanged in 0.6.0. Existing kits do not need to be re-published unless
454
+ you also want to drop the `akm-kit` keyword.
455
+
456
+ ## Sibling repositories
457
+
458
+ akm ships as three coordinated repositories. All three shipped the 0.6.0
459
+ terminology cut together:
460
+
461
+ - **`itlackey/akm`** (this repo) — the CLI. Ship as `akm-cli@0.6.0`.
462
+ - **`itlackey/akm-stash`** — the reference stash of official agent assets.
463
+ Its `package.json` `keywords` and repo topic both moved from `akm-kit`
464
+ to `akm-stash`. If you depend on the published npm package, pin the
465
+ 0.6.0-compatible release.
466
+ - **`itlackey/akm-registry`** — the build pipeline that generates the
467
+ public registry index. It now emits schema v3 (`stashes[]`). If you
468
+ self-host a registry built from this pipeline, pull the 0.6.0 tag and
469
+ regenerate your index — older clients (`akm-cli` 0.5.x) will not parse
470
+ v3, so you may want to keep two index URLs during your transition
471
+ window.
472
+
473
+ If you consume only the official hosted registry, no action is needed —
474
+ the registry already serves a v3 index from every 0.6.0+ CLI build.
475
+
476
+ ## New in 0.6.0 (bonus features)
477
+
478
+ These are additive — none of them require action to upgrade — but they
479
+ are worth a scan because they unlock new workflows once you're on 0.6.0.
480
+
481
+ - **Memory frontmatter on `akm remember` (#169).** `--tag`, `--expires`,
482
+ `--source`, plus opt-in `--auto` (heuristics) and `--enrich` (LLM)
483
+ attach structured metadata to memories so the indexer can rank them.
484
+ Bare `akm remember "body"` still writes a flat memory, so existing
485
+ agent scripts keep working. See [`akm remember`](../reference/cli.md#remember).
486
+ - **Workflow parser accepts intro prose (#158).** You can now put a
487
+ short advisory paragraph between `# Workflow:` and the first
488
+ `## Step:` without tripping a validation error.
489
+ - **Workflow resume reclassifies blocked steps (#156).** After
490
+ `akm workflow resume <id>`, the previously-blocked step becomes
491
+ actionable again so you can mark it `completed`, `failed`, or
492
+ `skipped`.
493
+ - **Workflow create works in clean stashes (#157).** `akm workflow
494
+ create <name>` and `--from <file>` no longer false-positive on a path
495
+ escape when any ancestor of your stash is a symlink (macOS `/tmp` →
496
+ `/private/tmp`, symlinked `HOME`, etc.).
497
+ - **Registry search filters incomplete hits (#159).** Providers that
498
+ return partial records no longer surface as empty `{}` objects in
499
+ JSON output; dropped counts appear in `warnings`.
500
+ - **Isolated sandbox recipe (#160).** Introduced a one-terminal recipe for a
501
+ throwaway `HOME + XDG_* + AKM_STASH_DIR` environment — handy for agent
502
+ testing, CI, and issue reproduction. See
503
+ [`docs/guides/getting-started.md`](../guides/getting-started.md) for the
504
+ current setup guide.
505
+ - **CI coverage for release branches (#170).** If you fork the repo or
506
+ run downstream CI off it, the shipped `.github/workflows/ci.yml` now
507
+ fires on PRs targeting `release/*` in addition to `main`.
508
+
509
+ ## Internal types and file renames (developers only)
510
+
511
+ These changes only affect contributors to akm itself or to projects that
512
+ import from akm's source. akm has no public API (no barrel exports, no
513
+ `exports` map in `package.json`), so importing from akm internals was
514
+ never officially supported — but we list the renames here for anyone who
515
+ was doing it anyway.
516
+
517
+ ### Type renames
518
+
519
+ | Before | After |
520
+ | --- | --- |
521
+ | `RegistryKitEntry` | `RegistryStashEntry` |
522
+ | `InstalledKitEntry` | `StashEntry` + `StashLockEntry` (split) |
523
+ | `InstalledKitListEntry` | `StashListEntry` |
524
+ | `KitInstallResult` | `StashInstallResult` |
525
+ | `KitInstallStatus` | `StashInstallStatus` |
526
+ | `KitSource` (`"npm" \| "github" \| "git" \| "local"`) | `StashSource["type"]` (`"filesystem" \| "git" \| "npm" \| "github" \| "website" \| "openviking"`) |
527
+
528
+ `StashSource` is a discriminated union per type — see
529
+ `src/stash-source.ts`.
530
+
531
+ ### Domain model unification (#123)
532
+
533
+ The old triplet of "source" / "kit" / "stash" is collapsed to a single
534
+ runtime concept: **stash**. `StashEntry` is the canonical shape used by
535
+ config, registry drafts, and the index. `kit` survives only as a
536
+ publishing concept (the bundle you ship via npm or GitHub).
537
+
538
+ The data shape of `StashEntry`:
539
+
540
+ ```ts
541
+ type StashEntry = {
542
+ name: string; // required, unique within config
543
+ type: StashSource["type"]; // discriminator
544
+ primary?: boolean; // exactly one entry may set this
545
+ enabled?: boolean; // default true
546
+ source: StashSource; // discriminated union per type
547
+ options?: Record<string, unknown>;
548
+ };
549
+ ```
550
+
551
+ `akm.lock` records the **resolved** state separately:
552
+
553
+ ```ts
554
+ type StashLockEntry = {
555
+ name: string; // matches StashEntry.name
556
+ resolvedVersion?: string; // for npm / github / git
557
+ resolvedRef?: string; // commit SHA / tarball SHA-256
558
+ cachePath?: string; // absolute path under ~/.cache/akm/
559
+ installedAt: string; // ISO timestamp
560
+ };
561
+ ```
562
+
563
+ ### File renames
564
+
565
+ | Before | After |
566
+ | --- | --- |
567
+ | `src/installed-kits.ts` | `src/installed-stashes.ts` |
568
+ | `src/registry-kit-entry.ts` | `src/registry-stash-entry.ts` |
569
+ | `docs/kit-makers.md` | `docs/stash-makers.md` (with a redirect stub at the old path) |
570
+ | `tests/installed-kits.test.ts` | `tests/installed-stashes.test.ts` |
571
+
572
+ The redirect stub at `docs/kit-makers.md` is a one-line link to
573
+ `stash-makers.md` so existing inbound links and `akm hints` snippets
574
+ continue to resolve.
575
+
576
+ ### context-hub removal (#124)
577
+
578
+ `src/providers/context-hub.ts` is removed. The old hardcoded provider type
579
+ is gone; `akm enable context-hub` and `akm disable context-hub` now error
580
+ with `STASH_NOT_FOUND` and a hint pointing at `akm add
581
+ github:andrewyng/context-hub`. context-hub remains usable as an ordinary
582
+ git stash — it is just a public repo.
583
+
584
+ If you previously imported `ContextHubProvider` directly, switch to the
585
+ generic `GitStashProvider` from `src/providers/git.ts`.
586
+
587
+ ### Registry-install fold (#125)
588
+
589
+ The `registry-install` path is folded into the unified install pipeline
590
+ in `src/install/`. `registry-install.ts` no longer exists as a top-level
591
+ module. The behaviour is unchanged — registry hits hand off to the same
592
+ install pipeline used by `akm add`, and audit/lock/index steps run in
593
+ the same order.
594
+
595
+ ### `cli.ts` decomposition (#126)
596
+
597
+ The monolithic `src/cli.ts` is split into per-command modules under
598
+ `src/cli/`. The exported `runCli()` function and the `akm` binary
599
+ behaviour are unchanged; this is purely an internal refactor. Tests that
600
+ imported helpers from `src/cli.ts` should now import from the
601
+ corresponding `src/cli/<command>.ts`.
602
+
603
+ ### Provider / dep refactor (#127)
604
+
605
+ `RegistryProvider` and `StashProvider` interfaces are aligned around a
606
+ shared `BaseProvider` shape with explicit lifecycle (`init`, `search`,
607
+ `show`, `dispose`). The dependency-injection wiring moves into
608
+ `src/provider-registry.ts`. Provider authors should re-read
609
+ [Registry Providers](../reference/registry.md#registry-providers) — the public
610
+ contract is unchanged but the internal hook points have moved.
611
+
612
+ ### Config ergonomics (#128)
613
+
614
+ Embedding and LLM connection config now share a `BaseConnectionConfig`
615
+ shape:
616
+
617
+ ```ts
618
+ type BaseConnectionConfig = {
619
+ endpoint?: string;
620
+ apiKey?: string;
621
+ model?: string;
622
+ headers?: Record<string, string>;
623
+ timeoutMs?: number;
624
+ };
625
+ ```
626
+
627
+ Both `embedding` and `llm` config keys accept this shape. Existing
628
+ configs continue to work — the previous fields are a strict subset.
629
+
630
+ A new `output.detail: "agent"` preset replaces the `--for-agent` flag
631
+ (see [Manual actions required §2](#2-replace---for-agent-with---detailagent)).
632
+
633
+ The `ASSET_TYPES` mutable array export is removed from public API. Use
634
+ `getAssetTypes()` from `src/asset-spec.ts` instead.
635
+
636
+ ## Removed without replacement
637
+
638
+ | Removed | Reason |
639
+ | --- | --- |
640
+ | `akm enable context-hub` | context-hub is just a git stash; use `akm add github:andrewyng/context-hub` |
641
+ | `akm disable context-hub` | same |
642
+ | `ASSET_TYPES` exported array | use `getAssetTypes()` (already existed) |
643
+ | `InstalledKitEntry` type | replaced by `StashEntry` + `StashLockEntry` (split) |
644
+ | `KitSource = "npm" \| "github" \| "git" \| "local"` type | replaced by `StashSource["type"]` |
645
+ | `disableGlobalStashes` config field | replaced by `stashInheritance: "merge" \| "replace"` |
646
+ | `installed[]` config array | now machine-managed in `akm.lock` |
647
+ | `kits[]` registry wire format | replaced by `stashes[]` (schema v3) |
648
+ | `akm-kit` keyword / topic for discovery | replaced by `akm-stash` |
649
+ | `context-hub` as a stash type | normalized to `git` at load time |
650
+
651
+ ## Verifying the upgrade
652
+
653
+ After upgrading, run:
654
+
655
+ ```sh
656
+ akm info
657
+ ```
658
+
659
+ Look for these signals that the migration completed cleanly:
660
+
661
+ - `version` reports `0.6.0` or higher.
662
+ - `stashProviders` lists only `filesystem`, `git`, and `openviking`.
663
+ - The output does **not** include any `context-hub` entries.
664
+ - `assetTypes` matches the types you expect.
665
+
666
+ Then:
667
+
668
+ ```sh
669
+ akm config list
670
+ akm list # doclint:ignore (historical — pre-0.9.0 command spelling)
671
+ ```
672
+
673
+ `akm config list` should show your `stashes[]` populated (including
674
+ entries that were migrated from the old `installed[]` array). `akm list`
675
+ should show `origin` and `access` columns instead of the old `kind`
676
+ column.
677
+
678
+ If `akm.lock` was created from a previous `stash.lock`, you should see it
679
+ at `~/.config/akm/akm.lock` (or under `AKM_CONFIG_DIR`).
680
+
681
+ A full reindex is **not** required by the upgrade. Run one only if you
682
+ also changed your embedding model or want to pick up new asset types:
683
+
684
+ ```sh
685
+ akm index --full
686
+ ```
687
+
688
+ ### Post-upgrade checklist
689
+
690
+ Five-step confirmation that nothing regressed:
691
+
692
+ ```sh
693
+ akm info --format text # 1. version 0.6.x, no context-hub provider
694
+ akm config list --format json | head -40 # 2. stashes[] populated; no `installed[]`
695
+ akm list # 3. your sources resolve; `origin`/`access` columns # doclint:ignore (historical — pre-0.9.0 command spelling)
696
+ akm workflow list --format json | head -20 # 4. any active workflow runs still show
697
+ akm search "<a query you know works>" --format json # 5. indexed content still matches
698
+ ```
699
+
700
+ If any step returns an error or missing data, see Troubleshooting below.
701
+
702
+ ## Troubleshooting
703
+
704
+ **"Unknown stash type 'context-hub'" after upgrade.**
705
+ Legacy aliases normalize at config load, but a truly corrupt entry can
706
+ still slip through. Run `akm config show` to see how your entry is
707
+ parsed. If it still rejects, edit `config.json` to set
708
+ `"type": "git"` and restore the URL from your backup.
709
+
710
+ **`registry search` returns `warnings: ["schema version 2 unsupported"]`.**
711
+ Your registry is still serving v2. Pull the latest `akm-registry` and
712
+ regenerate, or swap your registry URL to the official hosted one. See
713
+ [Migrating a self-hosted registry](#migrating-a-self-hosted-registry).
714
+
715
+ **`akm list` shows empty `stashes[]` but your 0.5.x config had entries.**
716
+ The migration copies `installed[]` into `stashes[]` only on the first
717
+ 0.6.0 command that **writes** config (e.g. `akm add`, `akm config set`).
718
+ If you've only run read-only commands, the new array may not yet be
719
+ populated. Run `akm add <any-stash>` or force a rewrite with
720
+ `akm config set stashes "$(akm config get stashes)"`.
721
+
722
+ **`akm workflow create <name>` in a fresh stash still errors `path
723
+ escapes the stash`.**
724
+ That was fixed in 0.6.0 (#157) — confirm you're on the 0.6.0 CLI with
725
+ `akm info | grep version`. If you are and still see it, the symlink
726
+ resolution is likely hitting an edge case; file an issue with the
727
+ output of `realpath "$AKM_STASH_DIR"`.
728
+
729
+ **`akm.lock` was not created.**
730
+ akm only creates the lockfile when it first writes to the stash
731
+ directory. Run any write command (`akm add`, `akm remember`,
732
+ `akm import`, `akm workflow create`) to generate it.
733
+
734
+ **`--for-agent` still works, but I want to migrate my scripts.**
735
+ Replace it with `--detail=agent` — same behaviour, preferred spelling.
736
+ The old flag is retained as a deprecated alias through at least the
737
+ 0.6.x series.
738
+
739
+ ## Rolling back
740
+
741
+ If you need to roll back to 0.5.x for any reason, the auto-migrations are
742
+ non-destructive but **your config.json may have been rewritten** to remove
743
+ `installed[]` if you ran any `akm config set` or `akm add` command on
744
+ 0.6.0. Restore from a backup if you need the old shape.
745
+
746
+ `akm.lock` is not read by 0.5.x — it will be ignored. Your stash content
747
+ itself is unchanged across versions; only the metadata layer evolves.
748
+
749
+ To pin to the last 0.5.x release:
750
+
751
+ ```sh
752
+ npm install -g akm-cli@0.5
753
+ # or
754
+ bun install -g akm-cli@0.5
755
+ ```
756
+
757
+ If you find a regression in 0.6.0, please file an issue at
758
+ <https://github.com/itlackey/akm/issues> with the output of `akm info`
759
+ and a redacted copy of your `config.json`.