akm-cli 0.9.0-rc.4 → 0.9.0-rc.6

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 (438) hide show
  1. package/CHANGELOG.md +122 -26
  2. package/README.md +7 -7
  3. package/SECURITY.md +11 -10
  4. package/dist/akm +2 -2
  5. package/dist/akm-migrate-storage +2 -2
  6. package/dist/assets/hints/cli-hints-full.md +60 -73
  7. package/dist/assets/hints/cli-hints-short.md +8 -12
  8. package/dist/assets/improve-strategies/default.json +5 -7
  9. package/dist/assets/improve-strategies/frequent.json +2 -2
  10. package/dist/assets/improve-strategies/proactive-maintenance.json +2 -2
  11. package/dist/assets/improve-strategies/quick.json +1 -1
  12. package/dist/assets/improve-strategies/reflect-distill.json +3 -3
  13. package/dist/assets/improve-strategies/thorough.json +1 -1
  14. package/dist/assets/prompts/consolidate-system.md +5 -5
  15. package/dist/assets/prompts/extract-session.md +2 -6
  16. package/dist/assets/prompts/reflect-llm-framed-contract.md +11 -0
  17. package/dist/assets/prompts/reflect-llm-schema-contract.md +3 -0
  18. package/dist/assets/prompts/reflect-output-repair.md +3 -0
  19. package/dist/assets/stash-skeleton/README.md +10 -11
  20. package/dist/assets/stash-skeleton/facts/conventions/assets/agent.md +1 -1
  21. package/dist/assets/stash-skeleton/facts/conventions/assets/fact.md +1 -1
  22. package/dist/assets/stash-skeleton/facts/conventions/assets/knowledge.md +1 -1
  23. package/dist/assets/stash-skeleton/facts/conventions/assets/lesson.md +2 -2
  24. package/dist/assets/stash-skeleton/facts/conventions/assets/memory.md +2 -2
  25. package/dist/assets/stash-skeleton/facts/conventions/assets/script.md +1 -1
  26. package/dist/assets/stash-skeleton/facts/conventions/assets/skill.md +2 -2
  27. package/dist/assets/stash-skeleton/facts/conventions/assets/workflow.md +1 -1
  28. package/dist/assets/stash-skeleton/facts/conventions/backlinks.md +18 -18
  29. package/dist/assets/stash-skeleton/facts/conventions/domains.md +8 -9
  30. package/dist/assets/stash-skeleton/facts/conventions/organization.md +13 -15
  31. package/dist/assets/tasks/core/extract.yml +2 -2
  32. package/dist/assets/tasks/core/improve.yml +1 -1
  33. package/dist/assets/templates/html/health.html +2 -3
  34. package/dist/cli/config-migrate.js +1328 -101
  35. package/dist/cli/invocation.js +255 -0
  36. package/dist/cli/parse-args.js +20 -83
  37. package/dist/cli/shared.js +15 -37
  38. package/dist/cli.js +18 -49
  39. package/dist/commands/agent/agent-dispatch.js +2 -2
  40. package/dist/commands/agent/contribute-cli.js +5 -4
  41. package/dist/commands/bundle/bundle-cli.js +68 -0
  42. package/dist/commands/bundle/bundle.js +219 -0
  43. package/dist/commands/completions.js +2 -2
  44. package/dist/commands/config-cli.js +6 -3
  45. package/dist/commands/env/env-binding.js +13 -9
  46. package/dist/commands/env/env-cli.js +49 -48
  47. package/dist/commands/env/secret-cli.js +24 -10
  48. package/dist/commands/events.js +2 -2
  49. package/dist/commands/feedback-cli.js +59 -33
  50. package/dist/commands/graph/graph.js +6 -4
  51. package/dist/commands/health/advisories.js +4 -4
  52. package/dist/commands/health/html-report.js +190 -593
  53. package/dist/commands/health/improve-metrics.js +240 -188
  54. package/dist/commands/health/metrics.js +9 -17
  55. package/dist/commands/health/report-view-model.js +509 -0
  56. package/dist/commands/health/surfaces.js +6 -3
  57. package/dist/commands/health/types-checks.js +4 -0
  58. package/dist/commands/health/types-improve.js +22 -0
  59. package/dist/commands/health/types-metrics.js +4 -0
  60. package/dist/commands/health/types-result.js +7 -0
  61. package/dist/commands/health/types-runs.js +4 -0
  62. package/dist/commands/health/types-session-log.js +4 -0
  63. package/dist/commands/health/types-windows.js +4 -0
  64. package/dist/commands/health/types.js +26 -21
  65. package/dist/commands/health/windows.js +1 -2
  66. package/dist/commands/health.js +219 -161
  67. package/dist/commands/improve/collapse-detector.js +25 -14
  68. package/dist/commands/improve/consolidate/chunking.js +7 -5
  69. package/dist/commands/improve/consolidate.js +640 -740
  70. package/dist/commands/improve/content-hash.js +39 -0
  71. package/dist/commands/improve/distill/content-repair.js +4 -10
  72. package/dist/commands/improve/distill/promote-memory.js +79 -49
  73. package/dist/commands/improve/distill/quality-gate.js +113 -35
  74. package/dist/commands/improve/distill-promotion-policy.js +24 -885
  75. package/dist/commands/improve/distill.js +565 -337
  76. package/dist/commands/improve/eligibility.js +75 -36
  77. package/dist/commands/improve/extract-cli.js +6 -6
  78. package/dist/commands/improve/extract-prompt.js +5 -34
  79. package/dist/commands/improve/extract.js +526 -357
  80. package/dist/commands/improve/feedback-valence.js +2 -12
  81. package/dist/commands/improve/improve-cli.js +11 -20
  82. package/dist/commands/improve/improve-result-file.js +7 -6
  83. package/dist/commands/improve/improve-run-types.js +4 -0
  84. package/dist/commands/improve/improve-strategies.js +3 -9
  85. package/dist/commands/improve/improve.js +822 -727
  86. package/dist/commands/improve/locks.js +27 -95
  87. package/dist/commands/improve/loop-stages.js +941 -963
  88. package/dist/commands/improve/memory/derived-ref.js +122 -0
  89. package/dist/commands/improve/memory/memory-contradiction-detect.js +35 -38
  90. package/dist/commands/improve/memory/memory-improve.js +24 -37
  91. package/dist/commands/improve/outcome-loop.js +13 -33
  92. package/dist/commands/improve/preparation.js +889 -691
  93. package/dist/commands/improve/proactive-maintenance.js +37 -9
  94. package/dist/commands/improve/proposal-envelope.js +31 -0
  95. package/dist/commands/improve/reflect.js +974 -588
  96. package/dist/commands/improve/run-context.js +119 -0
  97. package/dist/commands/improve/salience.js +8 -4
  98. package/dist/commands/improve/session-asset.js +7 -3
  99. package/dist/commands/improve/shared.js +14 -40
  100. package/dist/commands/improve/source-identity.js +39 -26
  101. package/dist/commands/improve/triage.js +20 -17
  102. package/dist/commands/lint/base-linter.js +288 -295
  103. package/dist/commands/lint/index.js +132 -19
  104. package/dist/commands/mv-cli.js +257 -234
  105. package/dist/commands/observability-cli.js +2 -1
  106. package/dist/commands/proposal/diff-format.js +50 -0
  107. package/dist/commands/proposal/drain-policies.js +0 -6
  108. package/dist/commands/proposal/drain.js +17 -16
  109. package/dist/commands/proposal/proposal-cli.js +40 -77
  110. package/dist/commands/proposal/proposal-types.js +56 -0
  111. package/dist/commands/proposal/proposal.js +39 -1
  112. package/dist/commands/proposal/propose.js +41 -19
  113. package/dist/commands/proposal/repository.js +566 -486
  114. package/dist/commands/proposal/validators/proposal-quality-validators.js +22 -6
  115. package/dist/commands/proposal/validators/proposal-validators.js +6 -5
  116. package/dist/commands/proposal/validators/proposals.js +5 -4
  117. package/dist/commands/read/curate.js +50 -28
  118. package/dist/commands/read/knowledge.js +25 -16
  119. package/dist/commands/read/remember-cli.js +12 -4
  120. package/dist/commands/read/search-cli.js +33 -33
  121. package/dist/commands/read/search.js +68 -55
  122. package/dist/commands/read/show.js +54 -135
  123. package/dist/commands/remember.js +7 -5
  124. package/dist/commands/sources/add-cli.js +10 -24
  125. package/dist/commands/sources/bundle-config-ops.js +58 -0
  126. package/dist/commands/sources/history.js +13 -8
  127. package/dist/commands/sources/info.js +10 -11
  128. package/dist/commands/sources/init.js +12 -21
  129. package/dist/commands/sources/installed-stashes.js +151 -138
  130. package/dist/commands/sources/schema-repair.js +5 -3
  131. package/dist/commands/sources/self-update.js +9 -7
  132. package/dist/commands/sources/source-add.js +116 -154
  133. package/dist/commands/sources/source-clone.js +33 -14
  134. package/dist/commands/sources/source-manage.js +43 -32
  135. package/dist/commands/sources/sources-cli.js +12 -7
  136. package/dist/commands/sources/stash-cli.js +12 -5
  137. package/dist/commands/sources/stash-skeleton.js +1 -1
  138. package/dist/commands/tasks/default-tasks.js +13 -13
  139. package/dist/commands/tasks/tasks-cli.js +3 -3
  140. package/dist/commands/tasks/tasks.js +71 -31
  141. package/dist/commands/workflow-cli.js +22 -26
  142. package/dist/core/action-contributors.js +1 -1
  143. package/dist/core/activation-policy.js +49 -0
  144. package/dist/core/adapter/adapters/agent-skills-adapter.js +181 -0
  145. package/dist/core/adapter/adapters/akm-adapter.js +509 -0
  146. package/dist/core/adapter/adapters/akm-lint.js +381 -0
  147. package/dist/core/adapter/adapters/akm-metadata.js +416 -0
  148. package/dist/core/adapter/adapters/akm-task-adapter.js +150 -0
  149. package/dist/core/adapter/adapters/akm-workflow-adapter.js +196 -0
  150. package/dist/core/adapter/adapters/claude-adapter.js +61 -0
  151. package/dist/core/adapter/adapters/dotenv-adapter.js +187 -0
  152. package/dist/core/adapter/adapters/generic-files-adapter.js +117 -0
  153. package/dist/core/adapter/adapters/index.js +80 -0
  154. package/dist/core/adapter/adapters/llm-wiki-adapter.js +413 -0
  155. package/dist/core/adapter/adapters/okf-adapter.js +223 -0
  156. package/dist/core/adapter/adapters/opencode-adapter.js +68 -0
  157. package/dist/core/adapter/adapters/shared.js +286 -0
  158. package/dist/core/adapter/adapters/tool-dir-shared.js +212 -0
  159. package/dist/core/adapter/adapters/website-snapshot-adapter.js +154 -0
  160. package/dist/core/adapter/bundle-adapter.js +4 -0
  161. package/dist/core/adapter/recognize-match.js +42 -0
  162. package/dist/core/adapter/registry.js +56 -0
  163. package/dist/core/adapter/types.js +4 -0
  164. package/dist/core/asset/asset-placement.js +229 -0
  165. package/dist/core/asset/asset-ref.js +107 -78
  166. package/dist/core/asset/asset-serialize.js +20 -0
  167. package/dist/core/asset/frontmatter.js +1 -1
  168. package/dist/core/asset/resolve-ref.js +223 -0
  169. package/dist/core/asset/stash-meta.js +1 -1
  170. package/dist/core/common.js +141 -49
  171. package/dist/core/config/config-io.js +0 -108
  172. package/dist/core/config/config-schema.js +94 -1039
  173. package/dist/core/config/config-sources.js +115 -36
  174. package/dist/core/config/config-types.js +16 -11
  175. package/dist/core/config/config-walker.js +4 -2
  176. package/dist/core/config/config.js +21 -26
  177. package/dist/core/config/engine-semantics.js +0 -4
  178. package/dist/core/config/schema/embedding.js +38 -0
  179. package/dist/core/config/schema/engines.js +116 -0
  180. package/dist/core/config/schema/feedback.js +31 -0
  181. package/dist/core/config/schema/improve-processes.js +395 -0
  182. package/dist/core/config/schema/improve.js +76 -0
  183. package/dist/core/config/schema/index-config.js +183 -0
  184. package/dist/core/config/schema/output.js +15 -0
  185. package/dist/core/config/schema/primitives.js +94 -0
  186. package/dist/core/config/schema/search.js +30 -0
  187. package/dist/core/config/schema/setup.js +27 -0
  188. package/dist/core/config/schema/sources-bundles.js +164 -0
  189. package/dist/core/config/schema/workflow.js +29 -0
  190. package/dist/core/env-secret-ref.js +113 -8
  191. package/dist/core/errors.js +1 -1
  192. package/dist/core/events-types.js +4 -0
  193. package/dist/core/extra-params.js +1 -0
  194. package/dist/core/file-change.js +16 -0
  195. package/dist/core/fs-txn.js +316 -0
  196. package/dist/core/git-message.js +59 -0
  197. package/dist/core/improve-result.js +9 -1
  198. package/dist/core/logs-db.js +1 -1
  199. package/dist/core/maintenance-barrier.js +16 -0
  200. package/dist/core/migration-backup.js +332 -160
  201. package/dist/core/paths.js +3 -6
  202. package/dist/core/platform.js +10 -0
  203. package/dist/core/recognition-util.js +130 -0
  204. package/dist/core/redaction.js +2 -2
  205. package/dist/core/standards/resolve-standards-context.js +47 -64
  206. package/dist/core/standards/resolve-type-conventions.js +3 -3
  207. package/dist/core/state/migrations.js +201 -8
  208. package/dist/core/state-db.js +38 -2
  209. package/dist/core/subprocess.js +303 -0
  210. package/dist/core/time.js +20 -0
  211. package/dist/core/type-presentation.js +130 -0
  212. package/dist/core/write-source.js +39 -67
  213. package/dist/indexer/bundle-identity-guard.js +91 -0
  214. package/dist/indexer/db/graph-db.js +1 -1
  215. package/dist/indexer/db/llm-cache.js +1 -1
  216. package/dist/indexer/ensure-index.js +29 -9
  217. package/dist/indexer/graph/graph-boost.js +28 -24
  218. package/dist/indexer/graph/graph-extraction.js +5 -6
  219. package/dist/indexer/graph/graph-types.js +4 -0
  220. package/dist/indexer/index-written-assets.js +44 -17
  221. package/dist/indexer/indexer.js +289 -153
  222. package/dist/indexer/init.js +18 -25
  223. package/dist/indexer/installations.js +224 -0
  224. package/dist/indexer/passes/dir-staleness.js +2 -1
  225. package/dist/indexer/passes/memory-inference.js +8 -4
  226. package/dist/indexer/passes/metadata.js +96 -243
  227. package/dist/indexer/scan/doc-to-entry.js +123 -0
  228. package/dist/indexer/scan/drain-dir.js +144 -0
  229. package/dist/indexer/search/db-search.js +171 -99
  230. package/dist/indexer/search/fts-query.js +1 -1
  231. package/dist/indexer/search/ranking-contributors.js +57 -7
  232. package/dist/indexer/search/ranking-types.js +4 -0
  233. package/dist/indexer/search/ranking.js +31 -6
  234. package/dist/indexer/search/search-attribution.js +67 -0
  235. package/dist/indexer/search/search-hit-enrichers.js +30 -40
  236. package/dist/indexer/search/search-source.js +109 -52
  237. package/dist/indexer/search/semantic-status.js +4 -1
  238. package/dist/indexer/usage/unmigrated-vaults-guard.js +2 -1
  239. package/dist/indexer/usage/usage-events.js +72 -9
  240. package/dist/indexer/walk/file-context.js +1 -44
  241. package/dist/indexer/walk/matchers.js +16 -32
  242. package/dist/indexer/walk/path-resolver.js +6 -5
  243. package/dist/indexer/walk/walker.js +4 -2
  244. package/dist/integrations/agent/engine-resolution.js +22 -0
  245. package/dist/integrations/agent/model-aliases.js +1 -1
  246. package/dist/integrations/agent/prompts.js +35 -11
  247. package/dist/integrations/agent/spawn.js +41 -270
  248. package/dist/integrations/harnesses/aider/agent-builder.js +2 -2
  249. package/dist/integrations/harnesses/aider/index.js +2 -11
  250. package/dist/integrations/harnesses/amazonq/agent-builder.js +1 -9
  251. package/dist/integrations/harnesses/amazonq/index.js +3 -16
  252. package/dist/integrations/harnesses/claude/config-import.js +1 -3
  253. package/dist/integrations/harnesses/claude/index.js +1 -12
  254. package/dist/integrations/harnesses/claude/session-log.js +27 -65
  255. package/dist/integrations/harnesses/codex/agent-builder.js +1 -2
  256. package/dist/integrations/harnesses/codex/index.js +2 -12
  257. package/dist/integrations/harnesses/copilot/agent-builder.js +2 -3
  258. package/dist/integrations/harnesses/copilot/index.js +1 -12
  259. package/dist/integrations/harnesses/gemini/agent-builder.js +1 -3
  260. package/dist/integrations/harnesses/gemini/index.js +1 -12
  261. package/dist/integrations/harnesses/ids.js +24 -0
  262. package/dist/integrations/harnesses/index.js +27 -2
  263. package/dist/integrations/harnesses/opencode/config-import.js +1 -3
  264. package/dist/integrations/harnesses/opencode/index.js +1 -12
  265. package/dist/integrations/harnesses/opencode/session-log.js +67 -110
  266. package/dist/integrations/harnesses/opencode-sdk/harness.js +2 -11
  267. package/dist/integrations/harnesses/openhands/agent-builder.js +3 -3
  268. package/dist/integrations/harnesses/openhands/index.js +2 -11
  269. package/dist/integrations/harnesses/pi/agent-builder.js +3 -11
  270. package/dist/integrations/harnesses/pi/index.js +3 -15
  271. package/dist/integrations/harnesses/shared.js +17 -0
  272. package/dist/integrations/harnesses/types.js +37 -2
  273. package/dist/integrations/lockfile.js +36 -0
  274. package/dist/integrations/session-logs/index.js +21 -12
  275. package/dist/integrations/session-logs/provider-base.js +113 -0
  276. package/dist/llm/client.js +7 -5
  277. package/dist/llm/embedders/deterministic.js +2 -2
  278. package/dist/llm/embedders/remote.js +8 -4
  279. package/dist/llm/graph-extract.js +7 -2
  280. package/dist/llm/metadata-enhance.js +43 -26
  281. package/dist/llm/structured-call.js +15 -7
  282. package/dist/migrate/legacy/config-source-migration.js +223 -0
  283. package/dist/migrate/legacy/content-migration.js +305 -0
  284. package/dist/migrate/legacy/legacy-layout.js +779 -0
  285. package/dist/migrate/legacy/legacy-paths.js +25 -0
  286. package/dist/migrate/legacy/legacy-stash-json.js +72 -0
  287. package/dist/migrate/legacy/proposal-fs-import.js +168 -0
  288. package/dist/migrate/legacy/task-target-ref-migration.js +272 -0
  289. package/dist/migrate/legacy/three-db-cutover.js +840 -0
  290. package/dist/migrate/legacy/workflow-migrations-bodies.js +52 -0
  291. package/dist/migrate/legacy/workflow-migrations-frozen.js +21 -0
  292. package/dist/migrate/legacy-ref-grammar.js +209 -0
  293. package/dist/output/command-registry.js +27 -0
  294. package/dist/output/html-render.js +11 -16
  295. package/dist/output/renderers.js +32 -276
  296. package/dist/output/shapes/passthrough.js +3 -9
  297. package/dist/output/shapes/registry.js +12 -6
  298. package/dist/output/text/command-format.js +547 -0
  299. package/dist/output/text/helpers.js +15 -1377
  300. package/dist/output/text/proposal-format.js +230 -0
  301. package/dist/output/text/registry.js +12 -6
  302. package/dist/output/text/show-directives.js +107 -0
  303. package/dist/output/text/show-format.js +103 -0
  304. package/dist/output/text/workflow-format.js +345 -0
  305. package/dist/output/text.js +1 -3
  306. package/dist/registry/build-index.js +13 -17
  307. package/dist/registry/providers/static-index.js +2 -2
  308. package/dist/registry/resolve.js +4 -90
  309. package/dist/registry/semver.js +93 -0
  310. package/dist/runtime.js +90 -0
  311. package/dist/schemas/akm-config.json +2956 -14890
  312. package/dist/schemas/akm-task.json +2 -2
  313. package/dist/schemas/akm-workflow.json +2 -2
  314. package/dist/scripts/migrate-storage.js +2312 -19642
  315. package/dist/setup/detect.js +5 -7
  316. package/dist/setup/engine-config.js +2 -1
  317. package/dist/setup/registry-stash-loader.js +1 -1
  318. package/dist/setup/semantic-assets.js +12 -9
  319. package/dist/setup/setup.js +109 -39
  320. package/dist/setup/steps/connection-shared.js +120 -0
  321. package/dist/setup/steps/connection.js +50 -274
  322. package/dist/setup/steps/platforms.js +1 -0
  323. package/dist/setup/steps/sources.js +13 -6
  324. package/dist/setup/steps/stashdir.js +5 -2
  325. package/dist/sources/freshness.js +39 -0
  326. package/dist/sources/providers/git-provider.js +29 -33
  327. package/dist/sources/providers/git-stash.js +10 -5
  328. package/dist/sources/providers/provider-utils.js +40 -18
  329. package/dist/sources/providers/website.js +1 -1
  330. package/dist/sources/resolve.js +5 -5
  331. package/dist/sources/snapshot-fetchers/types.js +4 -0
  332. package/dist/sources/{website-ingest.js → snapshot-fetchers/website-ingest.js} +105 -39
  333. package/dist/storage/database.js +47 -3
  334. package/dist/storage/engines/sqlite-migrations.js +34 -16
  335. package/dist/storage/locations.js +1 -2
  336. package/dist/storage/repositories/improve-runs-repository.js +0 -20
  337. package/dist/storage/repositories/index-connection.js +80 -0
  338. package/dist/storage/repositories/index-db.js +4 -3
  339. package/dist/storage/repositories/index-entries-repository.js +952 -0
  340. package/dist/{indexer/db/entry-mapper.js → storage/repositories/index-entry-mapper.js} +15 -2
  341. package/dist/storage/repositories/index-entry-types.js +4 -0
  342. package/dist/storage/repositories/index-fts-repository.js +164 -0
  343. package/dist/storage/repositories/index-llm-cache-repository.js +109 -0
  344. package/dist/storage/repositories/index-meta-repository.js +50 -0
  345. package/dist/{indexer/db/schema.js → storage/repositories/index-schema.js} +241 -100
  346. package/dist/storage/repositories/index-sql.js +12 -0
  347. package/dist/storage/repositories/index-utility-repository.js +369 -0
  348. package/dist/storage/repositories/index-vec-repository.js +245 -0
  349. package/dist/storage/repositories/proposals-repository.js +41 -50
  350. package/dist/storage/repositories/registry-cache.js +1 -1
  351. package/dist/storage/repositories/workflow-runs-repository.js +17 -11
  352. package/dist/tasks/backends/cron.js +5 -5
  353. package/dist/tasks/backends/exec-utils.js +21 -0
  354. package/dist/tasks/backends/index.js +6 -9
  355. package/dist/tasks/backends/launchd.js +16 -17
  356. package/dist/tasks/backends/schtasks.js +33 -41
  357. package/dist/tasks/backends/types.js +4 -0
  358. package/dist/tasks/parser.js +25 -5
  359. package/dist/tasks/runner.js +33 -39
  360. package/dist/tasks/validator.js +5 -6
  361. package/dist/workflows/authoring/authoring.js +8 -11
  362. package/dist/workflows/exec/brief.js +10 -7
  363. package/dist/workflows/exec/report.js +261 -156
  364. package/dist/workflows/exec/run-workflow.js +2 -1
  365. package/dist/workflows/exec/step-work.js +3 -9
  366. package/dist/workflows/program/parser.js +4 -60
  367. package/dist/workflows/renderer.js +11 -60
  368. package/dist/workflows/runtime/checkin.js +1 -1
  369. package/dist/workflows/runtime/plan-classifier.js +7 -4
  370. package/dist/workflows/runtime/runs.js +11 -10
  371. package/dist/workflows/runtime/unit-checkin.js +1 -1
  372. package/dist/workflows/runtime/unit-phases.js +20 -0
  373. package/dist/workflows/runtime/workflow-asset-loader.js +27 -16
  374. package/dist/workflows/validate-summary.js +2 -2
  375. package/dist/workflows/validator.js +18 -2
  376. package/docs/migration/release-notes/0.9.0.md +45 -3
  377. package/docs/migration/v0.8-to-v0.9.md +466 -262
  378. package/docs/{data-and-telemetry.md → reference/data-and-telemetry.md} +61 -17
  379. package/package.json +10 -9
  380. package/schemas/akm-config.json +2956 -14890
  381. package/schemas/akm-task.json +2 -2
  382. package/schemas/akm-workflow.json +2 -2
  383. package/dist/assets/help/help-accept.md +0 -12
  384. package/dist/assets/help/help-improve.md +0 -84
  385. package/dist/assets/help/help-proposals.md +0 -17
  386. package/dist/assets/help/help-propose.md +0 -17
  387. package/dist/assets/help/help-reject.md +0 -11
  388. package/dist/assets/improve-strategies/recombine-only.json +0 -23
  389. package/dist/assets/improve-strategies/synthesize.json +0 -17
  390. package/dist/assets/prompts/procedural-system.md +0 -44
  391. package/dist/assets/prompts/recombine-system.md +0 -40
  392. package/dist/assets/prompts/staleness-detect-system.md +0 -6
  393. package/dist/assets/templates/html/default.html +0 -78
  394. package/dist/assets/templates/html/vendor/echarts.min.js +0 -45
  395. package/dist/assets/wiki/index-template.md +0 -12
  396. package/dist/assets/wiki/ingest-workflow-template.md +0 -83
  397. package/dist/assets/wiki/log-template.md +0 -8
  398. package/dist/assets/wiki/schema-template.md +0 -61
  399. package/dist/commands/improve/calibration.js +0 -161
  400. package/dist/commands/improve/dedup.js +0 -482
  401. package/dist/commands/improve/hot-probation.js +0 -45
  402. package/dist/commands/improve/improve-auto-accept.js +0 -262
  403. package/dist/commands/improve/procedural.js +0 -403
  404. package/dist/commands/improve/recombine.js +0 -843
  405. package/dist/commands/improve/schema-similarity-gate.js +0 -168
  406. package/dist/commands/lint/agent-linter.js +0 -44
  407. package/dist/commands/lint/command-linter.js +0 -44
  408. package/dist/commands/lint/default-linter.js +0 -16
  409. package/dist/commands/lint/fact-linter.js +0 -39
  410. package/dist/commands/lint/knowledge-linter.js +0 -16
  411. package/dist/commands/lint/memory-linter.js +0 -61
  412. package/dist/commands/lint/registry.js +0 -41
  413. package/dist/commands/lint/skill-linter.js +0 -45
  414. package/dist/commands/lint/task-linter.js +0 -50
  415. package/dist/commands/lint/workflow-linter.js +0 -81
  416. package/dist/commands/proposal/legacy-import.js +0 -115
  417. package/dist/commands/wiki-cli.js +0 -291
  418. package/dist/core/asset/asset-registry.js +0 -76
  419. package/dist/core/asset/asset-spec.js +0 -316
  420. package/dist/core/eval/rank-metrics.js +0 -113
  421. package/dist/core/ripgrep/install.js +0 -163
  422. package/dist/core/ripgrep/resolve.js +0 -81
  423. package/dist/indexer/db/db.js +0 -1585
  424. package/dist/indexer/manifest.js +0 -170
  425. package/dist/indexer/passes/metadata-contributors.js +0 -31
  426. package/dist/integrations/harnesses/opencode-sdk/index.js +0 -25
  427. package/dist/output/text/wiki.js +0 -16
  428. package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +0 -18228
  429. package/dist/scripts/migrations/v16-to-v17.js +0 -141
  430. package/dist/storage/repositories/consolidation-repository.js +0 -38
  431. package/dist/storage/repositories/recombine-repository.js +0 -213
  432. package/dist/wiki/wiki-templates.js +0 -15
  433. package/dist/wiki/wiki.js +0 -1013
  434. package/dist/workflows/db.js +0 -413
  435. package/docs/README.md +0 -103
  436. package/docs/migration/release-notes/0.9.0-beta.60.md +0 -19
  437. /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/registry.js +0 -0
  438. /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/youtube.js +0 -0
@@ -16,13 +16,11 @@
16
16
  * `program/project.ts`, including a compact orchestration summary per
17
17
  * step (runner/model, `fanOut.over` expression, route table).
18
18
  */
19
- import { makeAssetRef } from "../core/asset/asset-ref.js";
19
+ import { displayRef } from "../core/asset/resolve-ref.js";
20
20
  import { UsageError } from "../core/errors.js";
21
- import { registerMetadataContributor } from "../indexer/passes/metadata-contributors.js";
22
21
  import { parseWorkflow } from "./parser.js";
23
22
  import { parseWorkflowProgram } from "./program/parser.js";
24
23
  import { programStepInstructions, projectProgramParameters, summarizeProgramStepOrchestration, WORKFLOW_PROGRAM_RENDERER_NAME, } from "./program/project.js";
25
- import { cacheWorkflowDocument } from "./runtime/document-cache.js";
26
24
  export { WORKFLOW_PROGRAM_RENDERER_NAME };
27
25
  function shellQuote(value) {
28
26
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -49,7 +47,12 @@ export const workflowMdRenderer = {
49
47
  buildShowResponse(ctx) {
50
48
  const name = deriveName(ctx);
51
49
  const doc = loadDocument(ctx);
52
- const ref = makeAssetRef("workflow", name, ctx.origin);
50
+ // WI-8.5b (display flip): the `akm workflow next <ref>` action is DISPLAY
51
+ // output — its spelling follows the D-R5 display rule (`displayRef`). A
52
+ // primary/default-bundle workflow renders the SHORT conceptId
53
+ // (`workflows/<name>`); a named source qualifies it as
54
+ // (`<bundle>//workflows/<name>`).
55
+ const ref = displayRef({ type: "workflow", name, bundleId: ctx.origin });
53
56
  return {
54
57
  type: "workflow",
55
58
  name,
@@ -82,7 +85,10 @@ export const workflowProgramRenderer = {
82
85
  buildShowResponse(ctx) {
83
86
  const name = deriveName(ctx);
84
87
  const program = loadProgram(ctx);
85
- const ref = makeAssetRef("workflow", name, ctx.origin);
88
+ // WI-8.5b (display flip): the `akm workflow next <ref>` action is DISPLAY
89
+ // output — its spelling follows the D-R5 display rule (`displayRef`), mirroring
90
+ // workflowMdRenderer above.
91
+ const ref = displayRef({ type: "workflow", name, bundleId: ctx.origin });
86
92
  const parameters = projectProgramParameters(program);
87
93
  return {
88
94
  type: "workflow",
@@ -106,58 +112,3 @@ export const workflowProgramRenderer = {
106
112
  };
107
113
  },
108
114
  };
109
- registerMetadataContributor({
110
- name: "workflow-document-metadata",
111
- appliesTo: ({ rendererName }) => rendererName === "workflow-md",
112
- contribute(entry, { renderContext }) {
113
- const doc = loadDocument(renderContext);
114
- const hints = new Set(entry.searchHints ?? []);
115
- hints.add(doc.title);
116
- for (const step of doc.steps) {
117
- hints.add(step.title);
118
- hints.add(step.id);
119
- hints.add(step.instructions.text);
120
- for (const criterion of step.completionCriteria ?? []) {
121
- hints.add(criterion.text);
122
- }
123
- }
124
- entry.searchHints = Array.from(hints).filter(Boolean);
125
- if (doc.parameters?.length) {
126
- entry.parameters = doc.parameters.map((p) => ({
127
- name: p.name,
128
- ...(p.description ? { description: p.description } : {}),
129
- }));
130
- }
131
- cacheWorkflowDocument(entry, doc);
132
- },
133
- });
134
- registerMetadataContributor({
135
- name: "workflow-program-metadata",
136
- appliesTo: ({ rendererName }) => rendererName === WORKFLOW_PROGRAM_RENDERER_NAME,
137
- contribute(entry, { renderContext }) {
138
- // Parse failures throw, which the metadata pass turns into a
139
- // skip-with-warning — broken programs never land in the index, mirroring
140
- // markdown workflows. No workflow_documents cache row is written: YAML
141
- // programs are re-parsed from disk by the runtime loader.
142
- const program = loadProgram(renderContext);
143
- const hints = new Set(entry.searchHints ?? []);
144
- hints.add(program.name);
145
- for (const step of program.steps) {
146
- hints.add(step.id);
147
- if (step.title)
148
- hints.add(step.title);
149
- hints.add(programStepInstructions(step));
150
- for (const criterion of step.gate?.criteria ?? []) {
151
- hints.add(criterion);
152
- }
153
- }
154
- entry.searchHints = Array.from(hints).filter(Boolean);
155
- if (!entry.description && program.description) {
156
- entry.description = program.description;
157
- }
158
- const parameters = projectProgramParameters(program);
159
- if (parameters?.length) {
160
- entry.parameters = parameters;
161
- }
162
- },
163
- });
@@ -5,7 +5,7 @@
5
5
  * Agent check-in: a no-background-thread "continue" nudge for stalled workflow
6
6
  * runs (#506).
7
7
  *
8
- * The design decision (see docs/technical/workflow-agent-checkin-adr.md)
8
+ * The design decision (the workflow-agent check-in ADR)
9
9
  * reconciles #506 (file/command-loop signal) with #501 (background thread) in
10
10
  * favour of the former. There is intentionally NO timer or resident process
11
11
  * here. Arming a check-in writes a timestamp (`checkin_armed_at`) on the run
@@ -133,9 +133,12 @@ export function assertWorkflowSpineMatchesPlan(plan, run, rows) {
133
133
  for (let index = 0; index < expected.length; index++) {
134
134
  const actual = rows[index];
135
135
  const planned = expected[index];
136
- if (!actual ||
137
- !planned ||
138
- actual.step_id !== planned.stepId ||
136
+ // The length check above (corruptSpine returns `never`) guarantees both are
137
+ // present; the guard narrows them and preserves the "missing row" message.
138
+ if (!actual || !planned) {
139
+ corruptSpine(run.id, `step row ${index} differs from the frozen plan (missing row)`);
140
+ }
141
+ if (actual.step_id !== planned.stepId ||
139
142
  actual.step_title !== planned.stepTitle ||
140
143
  actual.instructions !== planned.instructions ||
141
144
  actual.completion_json !== planned.completionJson ||
@@ -147,7 +150,7 @@ export function assertWorkflowSpineMatchesPlan(plan, run, rows) {
147
150
  actual.completion_json !== planned.completionJson ? "completion_json" : "",
148
151
  actual.sequence_index !== planned.sequenceIndex ? "sequence_index" : "",
149
152
  ].filter(Boolean);
150
- corruptSpine(run.id, `step row ${index} differs from the frozen plan (${fields.join(", ") || "missing row"})`);
153
+ corruptSpine(run.id, `step row ${index} differs from the frozen plan (${fields.join(", ")})`);
151
154
  }
152
155
  }
153
156
  if (run.current_step_id !== null && !expected.some((step) => step.stepId === run.current_step_id))
@@ -2,11 +2,10 @@
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
4
  import { randomUUID } from "node:crypto";
5
- import { parseAssetRef } from "../../core/asset/asset-ref.js";
6
- import { canonicalizeWorkflowName } from "../../core/asset/asset-spec.js";
7
5
  import { loadConfig } from "../../core/config/config.js";
8
6
  import { NotFoundError, UsageError } from "../../core/errors.js";
9
7
  import { appendEvent } from "../../core/events.js";
8
+ import { canonicalizeWorkflowName } from "../../core/recognition-util.js";
10
9
  import { warn } from "../../core/warn.js";
11
10
  import { withWorkflowRunsRepo, } from "../../storage/repositories/workflow-runs-repository.js";
12
11
  import { getCurrentWorkflowScopeKey } from "../authoring/scope-key.js";
@@ -22,7 +21,7 @@ import { resolveAgentIdentity } from "./agent-identity.js";
22
21
  import { evaluateCheckin } from "./checkin.js";
23
22
  import { assertWorkflowSpineMatchesPlan, classifyWorkflowRunPlan, frozenStepRows, requireAbandonableWorkflowPlan, requireExecutableWorkflowPlan, } from "./plan-classifier.js";
24
23
  import { evaluateStaleUnits } from "./unit-checkin.js";
25
- import { loadWorkflowAsset, resolveWorkflowEntryId } from "./workflow-asset-loader.js";
24
+ import { canonicalWorkflowRunRef, loadWorkflowAsset, parseWorkflowRefInput, resolveWorkflowEntryId, } from "./workflow-asset-loader.js";
26
25
  /** Clip bound for a unit's `result_json` on the `--units` diagnostic surface. */
27
26
  const UNIT_DIAGNOSTIC_CLIP = 2000;
28
27
  function toUnitDiagnostic(row, stale, plannedEngine) {
@@ -118,7 +117,7 @@ export async function startWorkflowRun(ref, params = {}, options) {
118
117
  }
119
118
  }
120
119
  // #506: arm a file-signal check-in (a timestamp, NOT a background thread —
121
- // see docs/technical/workflow-agent-checkin-adr.md) so a stalled run can be
120
+ // per the workflow-agent check-in ADR) so a stalled run can be
122
121
  // re-targeted with a `continue` directive. The agent harness + session id
123
122
  // are already resolved above (agentHarness/agentSessionId, from #501).
124
123
  repo.transaction(() => {
@@ -199,11 +198,11 @@ export async function listWorkflowRuns(input) {
199
198
  const scopeKey = getCurrentWorkflowScopeKey();
200
199
  let workflowRef;
201
200
  if (input?.workflowRef) {
202
- const parsed = parseAssetRef(input.workflowRef);
201
+ const parsed = parseWorkflowRefInput(input.workflowRef);
203
202
  if (parsed.type !== "workflow") {
204
- throw new UsageError(`Expected a workflow ref (workflow:<name>), got "${input.workflowRef}".`);
203
+ throw new UsageError(`Expected a workflow ref (workflows/<name>), got "${input.workflowRef}".`);
205
204
  }
206
- workflowRef = `${parsed.origin ? `${parsed.origin}//` : ""}workflow:${canonicalizeWorkflowName(parsed.name)}`;
205
+ workflowRef = canonicalWorkflowRunRef(parsed.origin, canonicalizeWorkflowName(parsed.name));
207
206
  }
208
207
  const rows = repo.listRuns({
209
208
  scopeKey,
@@ -481,14 +480,16 @@ async function resolveRunSpecifier(repo, specifier, params) {
481
480
  }
482
481
  return { run: explicitRun, autoStarted: false };
483
482
  }
484
- if (!specifier.includes(":")) {
483
+ // Run-id vs workflow-ref disambiguation: a run id is a bare token, while a
484
+ // canonical `workflows/name` ref carries a `/`.
485
+ if (!specifier.includes(":") && !specifier.includes("/")) {
485
486
  throw new NotFoundError(`Workflow run "${specifier}" not found.`, "WORKFLOW_NOT_FOUND");
486
487
  }
487
- const parsed = parseAssetRef(specifier);
488
+ const parsed = parseWorkflowRefInput(specifier);
488
489
  if (parsed.type !== "workflow") {
489
490
  throw new UsageError(`Expected a workflow ref or workflow run id, got "${specifier}".`);
490
491
  }
491
- const ref = `${parsed.origin ? `${parsed.origin}//` : ""}workflow:${canonicalizeWorkflowName(parsed.name)}`;
492
+ const ref = canonicalWorkflowRunRef(parsed.origin, canonicalizeWorkflowName(parsed.name));
492
493
  const scopeKey = getCurrentWorkflowScopeKey();
493
494
  const active = repo.getActiveRunRowForScope(ref, scopeKey);
494
495
  if (active) {
@@ -1,7 +1,7 @@
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
- import { GATE_EVALUATION_PHASE } from "../exec/step-work.js";
4
+ import { GATE_EVALUATION_PHASE } from "./unit-phases.js";
5
5
  /**
6
6
  * Default staleness window. A unit claimed `running` whose last heartbeat (or,
7
7
  * absent any heartbeat, its first claim) is older than this is surfaced as
@@ -0,0 +1,20 @@
1
+ // This Source Code Form is subject to the terms of the Mozilla Public
2
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ /**
5
+ * Unit-row phase markers — a leaf module (imports nothing) so both the exec
6
+ * drivers (step-work, brief, run-workflow) and the runtime (unit-checkin) can
7
+ * key on the phase discriminator without an exec ↔ runtime import cycle.
8
+ * Extracting {@link GATE_EVALUATION_PHASE} here broke the last workflows-
9
+ * runtime knot (step-work → runs → unit-checkin → step-work; chunk-8 WI-8.6,
10
+ * DoD 11).
11
+ */
12
+ /**
13
+ * `phase` marker stamped on gate-evaluation unit rows. Step ids cannot contain
14
+ * dots (`PROGRAM_STEP_ID_PATTERN`), so a step can never be NAMED `x.gate` and
15
+ * the synthetic `<stepId>.gate` node id is collision-free against user step
16
+ * ids. The phase column is nonetheless the discriminator we key on — an
17
+ * explicit marker, not a `node_id` suffix match, so recovery stays robust even
18
+ * if the id scheme evolves. Dispatch rows always journal `phase: null`.
19
+ */
20
+ export const GATE_EVALUATION_PHASE = "gate";
@@ -2,11 +2,12 @@
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
4
  import fs from "node:fs";
5
- import { parseAssetRef } from "../../core/asset/asset-ref.js";
6
- import { canonicalizeWorkflowName } from "../../core/asset/asset-spec.js";
5
+ import { parseRefInput } from "../../core/asset/resolve-ref.js";
6
+ import { resolveStashDir } from "../../core/common.js";
7
7
  import { loadConfig } from "../../core/config/config.js";
8
8
  import { NotFoundError, UsageError } from "../../core/errors.js";
9
9
  import { getDbPath } from "../../core/paths.js";
10
+ import { canonicalizeWorkflowName } from "../../core/recognition-util.js";
10
11
  import { resolveSourceEntries } from "../../indexer/search/search-source.js";
11
12
  import { resolveSourcesForOrigin } from "../../registry/origin-resolve.js";
12
13
  import { resolveAssetPath } from "../../sources/resolve.js";
@@ -16,17 +17,27 @@ import { parseWorkflow } from "../parser.js";
16
17
  import { parseWorkflowProgram } from "../program/parser.js";
17
18
  import { isWorkflowProgramPath, projectProgramParameters, projectProgramStepDefinitions } from "../program/project.js";
18
19
  /**
19
- * Resolve a `workflow:<name>` ref to a fully-projected {@link WorkflowAsset}.
20
- *
21
- * Prefers the parsed document cached in `index.db` (fast path) and falls back to
22
- * reading + parsing the source file from disk. Pure loading/parsing concern —
23
- * extracted from the run repository so run orchestration no longer owns asset
24
- * resolution.
20
+ * The canonical durable `workflow_runs.workflow_ref` run-key:
21
+ * `[origin//]workflows/<canonical-name>` (normative §11.4 — the chunk-8
22
+ * cutover re-keys pre-existing legacy rows onto this spelling; every mint
23
+ * site MUST build the key through this one helper).
24
+ */
25
+ export function canonicalWorkflowRunRef(origin, canonicalName) {
26
+ return `${origin ? `${origin}//` : ""}workflows/${canonicalName}`;
27
+ }
28
+ /** Parse a workflow ref using the canonical `[bundle//]workflows/<name>` grammar. */
29
+ export function parseWorkflowRefInput(ref) {
30
+ return parseRefInput(ref.trim());
31
+ }
32
+ /**
33
+ * Resolve a workflow ref to a fully-projected {@link WorkflowAsset}. Prefers the
34
+ * parsed document cached in `index.db` (fast path) and falls back to reading +
35
+ * parsing the source file from disk.
25
36
  */
26
37
  export async function loadWorkflowAsset(ref) {
27
- const parsed = parseAssetRef(ref);
38
+ const parsed = parseWorkflowRefInput(ref);
28
39
  if (parsed.type !== "workflow") {
29
- throw new UsageError(`Expected a workflow ref (workflow:<name>), got "${ref}".`);
40
+ throw new UsageError(`Expected a workflow ref (workflows/<name>), got "${ref}".`);
30
41
  }
31
42
  const config = loadConfig();
32
43
  const allSources = resolveSourceEntries(undefined, config);
@@ -44,16 +55,16 @@ export async function loadWorkflowAsset(ref) {
44
55
  }
45
56
  }
46
57
  if (!assetPath) {
47
- throw new NotFoundError(`Workflow not found for ref: workflow:${parsed.name}`);
58
+ throw new NotFoundError(`Workflow not found for ref: workflows/${parsed.name}`);
48
59
  }
49
- const resolvedSourcePath = sourcePath ?? config.stashDir ?? assetPath;
50
- // Canonicalize the stored ref: `workflow:foo.yaml` and `workflow:foo`
60
+ const resolvedSourcePath = sourcePath ?? resolveStashDir() ?? assetPath;
61
+ // Canonicalize the stored ref: `workflows/foo.yaml` and `workflows/foo`
51
62
  // resolve to the same file, so they MUST share one run identity. The raw
52
63
  // `parsed.name` (with any extension) is what drives file resolution above;
53
64
  // only the persisted/queried ref is collapsed (matches the index entry key,
54
65
  // which is keyed by the extension-stripped canonical name).
55
66
  const canonicalName = canonicalizeWorkflowName(parsed.name);
56
- const fullRef = `${parsed.origin ? `${parsed.origin}//` : ""}workflow:${canonicalName}`;
67
+ const fullRef = canonicalWorkflowRunRef(parsed.origin, canonicalName);
57
68
  // Format detection by extension: `.yaml`/`.yml` is a YAML workflow program
58
69
  // (redesign addendum, R1); everything else is the markdown document format.
59
70
  if (isWorkflowProgramPath(assetPath)) {
@@ -71,7 +82,7 @@ export async function loadWorkflowAsset(ref) {
71
82
  export function resolveWorkflowEntryId(sourcePath, ref) {
72
83
  if (!fs.existsSync(getDbPath()))
73
84
  return null;
74
- const parsed = parseAssetRef(ref);
85
+ const parsed = parseWorkflowRefInput(ref);
75
86
  const entryKey = `${sourcePath}:${parsed.type}:${parsed.name}`;
76
87
  return withIndexDb((db) => {
77
88
  const row = db
@@ -103,7 +114,7 @@ function loadWorkflowDocumentFromDisk(assetPath) {
103
114
  function readWorkflowDocumentFromIndex(sourcePath, ref) {
104
115
  if (!fs.existsSync(getDbPath()))
105
116
  return null;
106
- const parsed = parseAssetRef(ref);
117
+ const parsed = parseWorkflowRefInput(ref);
107
118
  const entryKey = `${sourcePath}:${parsed.type}:${parsed.name}`;
108
119
  return withIndexDb((db) => {
109
120
  const row = db
@@ -11,8 +11,8 @@
11
11
  *
12
12
  * The LLM call is injected (`judge`) so the gate is unit-testable without a
13
13
  * live endpoint, and the whole gate is fail-open: when no criteria exist or no
14
- * judge is available the step completes as before. See
15
- * docs/technical/workflow-agent-checkin-adr.md.
14
+ * judge is available the step completes as before (per the workflow-agent
15
+ * check-in ADR).
16
16
  *
17
17
  * @module workflows/validate-summary
18
18
  */
@@ -8,7 +8,8 @@
8
8
  * the whole document or the raw frontmatter at once: duplicate step IDs,
9
9
  * step-id format, and the frontmatter key whitelist.
10
10
  */
11
- import { parseAssetRef, refToString } from "../core/asset/asset-ref.js";
11
+ import { isBundleSlug } from "../core/asset/asset-ref.js";
12
+ import { conceptIdFromTypeName, parseRefInput } from "../core/asset/resolve-ref.js";
12
13
  import { utf8Bytes, WORKFLOW_MAX_INSTRUCTION_BYTES, WORKFLOW_MAX_PARAMS, WORKFLOW_MAX_STEPS } from "./resource-limits.js";
13
14
  const STEP_ID_REGEX = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
14
15
  const ALLOWED_FRONTMATTER_KEYS = new Set(["description", "tags", "params", "name", "updated", "when_to_use", "xrefs"]);
@@ -28,7 +29,22 @@ function checkXrefs(value, line, errors) {
28
29
  }
29
30
  for (const ref of value) {
30
31
  try {
31
- if (typeof ref !== "string" || refToString(parseAssetRef(ref)) !== ref)
32
+ if (typeof ref !== "string")
33
+ throw new Error("non-canonical ref");
34
+ // Canonicity accepts BOTH grammars during the transition (WI-8.5a flipped
35
+ // the content writers to the new grammar; existing content still carries
36
+ // legacy xrefs — the dual-reader arm stays alive until WI-8.5b): the new
37
+ // bare `conceptId` (or slug-clean `bundle//conceptId`) that lint/mv now
38
+ // recognize, OR the legacy `[origin//]type:name` round-trip.
39
+ const p = parseRefInput(ref);
40
+ const conceptId = conceptIdFromTypeName(p.type, p.name);
41
+ const newCanonical = p.origin !== undefined && p.origin !== "local" && p.origin !== "stash"
42
+ ? isBundleSlug(p.origin)
43
+ ? `${p.origin}//${conceptId}`
44
+ : `${p.origin}//${p.type}:${p.name}`
45
+ : conceptId;
46
+ const legacyCanonical = p.origin ? `${p.origin}//${p.type}:${p.name}` : `${p.type}:${p.name}`;
47
+ if (ref !== newCanonical && ref !== legacyCanonical)
32
48
  throw new Error("non-canonical ref");
33
49
  }
34
50
  catch {
@@ -5,21 +5,57 @@ were already running a 0.9.0 beta, align scripts, prompts, and stash layout
5
5
  with the current command surface and verify every durable artifact before
6
6
  normal use.
7
7
 
8
+ Heads-up: 0.9.x is a refactoring and clean-up release series. Patch
9
+ releases may include breaking changes (each called out in the CHANGELOG with
10
+ a migration note) until the remaining technical debt is paid off; the 0.10.x
11
+ series returns to bug fixes and tuning with breaking changes only in major
12
+ and minor releases. See STABILITY.md for the full policy.
13
+
8
14
  Key operator-facing changes:
9
15
 
10
- - The published npm package requires Node.js >= 20.12 as its cross-platform
16
+ - **This release is the format-neutral bundle-adapter refactor.** The flat
17
+ asset-type registry is replaced by per-format adapters, and refs move from the
18
+ old `type:name` grammar to `[bundle//]conceptId` — a subdir-qualified concept
19
+ id such as `skills/code-review`, `memories/vpn-note`, or `env/prod`, with an
20
+ optional `bundle//` installation prefix and an optional `#fragment`. Durable
21
+ state is stored fully-qualified; the short bundle-omitted form is input sugar
22
+ (resolved against `defaultBundle`, then installation-priority order).
23
+ `akm migrate apply` re-keys all durable state, folds the former `workflow.db`
24
+ into `state.db` (three databases: `state.db` / `index.db` / a separate
25
+ `logs.db`, down from four), and migrates config from the flat `stashDir` /
26
+ `sources` / `installed` / `wikiName` keys to `bundles` / `defaultBundle`.
27
+ `index.md` / `log.md` are reserved structural files — never indexed as
28
+ concepts and never valid write targets.
29
+ - **Installed non-akm bundles reclassify on your next `akm index`.** The
30
+ indexer now dispatches each installed bundle's *detected* adapter instead of
31
+ recognizing everything with the akm-stash adapter. No action needed — the
32
+ index is a regenerable cache — but searches/saved refs into those bundles may
33
+ resolve to new ref spellings afterwards.
34
+ - The published npm package requires Node.js >= 22 as its cross-platform
11
35
  bootstrap. When a working Bun >= 1.0 is also on `PATH`, the launcher prefers
12
36
  Bun after bootstrap; old, unusable, or absent Bun installations fall back to
13
37
  Node.js. The standalone binaries are runtime-free.
14
38
  - The legacy `vault` asset type and `akm vault ...` command family are gone.
15
- Use `env:` for whole `.env` groups and `secret:` for a single sensitive
16
- value.
39
+ Use `env/<name>` for whole `.env` groups and `secrets/<name>` for a single
40
+ sensitive value.
41
+ - `akm save` is replaced by `akm sync` for writable-stash persistence and
42
+ pushes, and `akm events` is replaced by `akm log`.
43
+ - The entire `akm wiki ...` command family and the `wiki` asset type are gone.
44
+ The Karpathy-style LLM wiki structure (`schema.md` + `pages/`) is now a
45
+ first-class **bundle format** recognized directly by `akm index`/`akm
46
+ search`/`akm lint` — no dedicated verb surface needed.
17
47
  - `akm-migrate-storage` still ships and still performs the non-destructive
18
48
  `vaults/` -> `env/` copy for older stashes. Run it before indexing if you are
19
49
  upgrading from a stash that still stores `.env` files only under `vaults/`.
20
50
  - Proposal workflow is fully consolidated around `akm improve`, `akm propose`,
21
51
  and `akm proposal ...`. Update any old `akm reflect`, `akm distill`,
22
52
  `akm accept`, `akm reject`, or `akm proposals` usage.
53
+ - LLM-backed sustaining work is opt-in in the shipped presets: improve-stage
54
+ extract is off in `default` and `frequent`, and `proactiveMaintenance` is off
55
+ in `default` and `reflect-distill`. The dedicated `proactive-maintenance`
56
+ strategy remains enabled as an explicit opt-in. Presets that omit these
57
+ fields inherit the `default` off values, while an explicit user
58
+ `enabled: true` override still wins.
23
59
  - Config, `state.db`, and `workflow.db` are now classified independently by the
24
60
  explicit `akm migrate` coordinator. Normal commands refuse old, future, or
25
61
  divergent durable schemas instead of attempting migration as a side effect.
@@ -54,5 +90,11 @@ Required upgrade checks:
54
90
  `current`; indexing does not migrate config or durable schemas.
55
91
  - Review agent instructions and docs for old `vault`, `reflect`, and `distill`
56
92
  examples.
93
+ - Review scheduled improve invocations if they relied on inherited extract or
94
+ proactive-maintenance enablement. Standalone extraction remains available,
95
+ but every command must select `--type <harness>` or `--auto`; bare
96
+ `akm extract` is invalid. Update any installed bare extract task to
97
+ `akm extract --auto` for all-harness discovery. The bundled template remains
98
+ an unselected opt-in and now uses that valid command.
57
99
 
58
100
  Full changelog: https://github.com/itlackey/akm/blob/main/CHANGELOG.md