akm-cli 0.9.0-rc.5 → 0.9.0-rc.7

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 (430) hide show
  1. package/CHANGELOG.md +116 -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 +73 -47
  73. package/dist/commands/improve/distill/quality-gate.js +30 -15
  74. package/dist/commands/improve/distill-promotion-policy.js +24 -885
  75. package/dist/commands/improve/distill.js +564 -341
  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 +524 -358
  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 +781 -668
  86. package/dist/commands/improve/locks.js +6 -2
  87. package/dist/commands/improve/loop-stages.js +938 -965
  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 +886 -692
  93. package/dist/commands/improve/proactive-maintenance.js +33 -3
  94. package/dist/commands/improve/proposal-envelope.js +31 -0
  95. package/dist/commands/improve/reflect.js +962 -549
  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/file-change.js +16 -0
  194. package/dist/core/fs-txn.js +316 -0
  195. package/dist/core/git-message.js +59 -0
  196. package/dist/core/improve-result.js +9 -1
  197. package/dist/core/logs-db.js +1 -1
  198. package/dist/core/migration-backup.js +335 -162
  199. package/dist/core/paths.js +3 -6
  200. package/dist/core/platform.js +10 -0
  201. package/dist/core/recognition-util.js +130 -0
  202. package/dist/core/redaction.js +2 -2
  203. package/dist/core/standards/resolve-standards-context.js +47 -64
  204. package/dist/core/standards/resolve-type-conventions.js +3 -3
  205. package/dist/core/state/migrations.js +201 -8
  206. package/dist/core/state-db.js +38 -2
  207. package/dist/core/subprocess.js +303 -0
  208. package/dist/core/time.js +20 -0
  209. package/dist/core/type-presentation.js +130 -0
  210. package/dist/core/write-source.js +38 -67
  211. package/dist/indexer/bundle-identity-guard.js +91 -0
  212. package/dist/indexer/db/graph-db.js +1 -1
  213. package/dist/indexer/db/llm-cache.js +1 -1
  214. package/dist/indexer/ensure-index.js +28 -10
  215. package/dist/indexer/graph/graph-boost.js +28 -24
  216. package/dist/indexer/graph/graph-extraction.js +5 -6
  217. package/dist/indexer/graph/graph-types.js +4 -0
  218. package/dist/indexer/index-written-assets.js +44 -17
  219. package/dist/indexer/indexer.js +289 -153
  220. package/dist/indexer/init.js +18 -25
  221. package/dist/indexer/installations.js +224 -0
  222. package/dist/indexer/passes/dir-staleness.js +2 -1
  223. package/dist/indexer/passes/memory-inference.js +8 -4
  224. package/dist/indexer/passes/metadata.js +96 -243
  225. package/dist/indexer/scan/doc-to-entry.js +123 -0
  226. package/dist/indexer/scan/drain-dir.js +144 -0
  227. package/dist/indexer/search/db-search.js +171 -99
  228. package/dist/indexer/search/fts-query.js +1 -1
  229. package/dist/indexer/search/ranking-contributors.js +57 -7
  230. package/dist/indexer/search/ranking-types.js +4 -0
  231. package/dist/indexer/search/ranking.js +31 -6
  232. package/dist/indexer/search/search-attribution.js +67 -0
  233. package/dist/indexer/search/search-hit-enrichers.js +30 -40
  234. package/dist/indexer/search/search-source.js +109 -52
  235. package/dist/indexer/search/semantic-status.js +4 -1
  236. package/dist/indexer/usage/unmigrated-vaults-guard.js +2 -1
  237. package/dist/indexer/usage/usage-events.js +72 -9
  238. package/dist/indexer/walk/file-context.js +1 -44
  239. package/dist/indexer/walk/matchers.js +16 -32
  240. package/dist/indexer/walk/path-resolver.js +6 -5
  241. package/dist/indexer/walk/walker.js +4 -2
  242. package/dist/integrations/agent/engine-resolution.js +22 -0
  243. package/dist/integrations/agent/model-aliases.js +1 -1
  244. package/dist/integrations/agent/prompts.js +35 -11
  245. package/dist/integrations/agent/spawn.js +41 -270
  246. package/dist/integrations/harnesses/aider/agent-builder.js +2 -2
  247. package/dist/integrations/harnesses/aider/index.js +2 -11
  248. package/dist/integrations/harnesses/amazonq/agent-builder.js +1 -9
  249. package/dist/integrations/harnesses/amazonq/index.js +3 -16
  250. package/dist/integrations/harnesses/claude/config-import.js +1 -3
  251. package/dist/integrations/harnesses/claude/index.js +1 -12
  252. package/dist/integrations/harnesses/claude/session-log.js +27 -65
  253. package/dist/integrations/harnesses/codex/agent-builder.js +1 -2
  254. package/dist/integrations/harnesses/codex/index.js +2 -12
  255. package/dist/integrations/harnesses/copilot/agent-builder.js +2 -3
  256. package/dist/integrations/harnesses/copilot/index.js +1 -12
  257. package/dist/integrations/harnesses/gemini/agent-builder.js +1 -3
  258. package/dist/integrations/harnesses/gemini/index.js +1 -12
  259. package/dist/integrations/harnesses/ids.js +24 -0
  260. package/dist/integrations/harnesses/index.js +27 -2
  261. package/dist/integrations/harnesses/opencode/config-import.js +1 -3
  262. package/dist/integrations/harnesses/opencode/index.js +1 -12
  263. package/dist/integrations/harnesses/opencode/session-log.js +67 -110
  264. package/dist/integrations/harnesses/opencode-sdk/harness.js +2 -11
  265. package/dist/integrations/harnesses/openhands/agent-builder.js +3 -3
  266. package/dist/integrations/harnesses/openhands/index.js +2 -11
  267. package/dist/integrations/harnesses/pi/agent-builder.js +3 -11
  268. package/dist/integrations/harnesses/pi/index.js +3 -15
  269. package/dist/integrations/harnesses/shared.js +17 -0
  270. package/dist/integrations/harnesses/types.js +37 -2
  271. package/dist/integrations/lockfile.js +36 -0
  272. package/dist/integrations/session-logs/index.js +21 -12
  273. package/dist/integrations/session-logs/provider-base.js +113 -0
  274. package/dist/llm/embedders/deterministic.js +2 -2
  275. package/dist/llm/embedders/remote.js +8 -4
  276. package/dist/llm/graph-extract.js +7 -2
  277. package/dist/llm/metadata-enhance.js +43 -26
  278. package/dist/llm/structured-call.js +15 -7
  279. package/dist/migrate/legacy/config-source-migration.js +223 -0
  280. package/dist/migrate/legacy/content-migration.js +305 -0
  281. package/dist/migrate/legacy/legacy-layout.js +779 -0
  282. package/dist/migrate/legacy/legacy-paths.js +25 -0
  283. package/dist/migrate/legacy/legacy-stash-json.js +72 -0
  284. package/dist/migrate/legacy/proposal-fs-import.js +168 -0
  285. package/dist/migrate/legacy/task-target-ref-migration.js +272 -0
  286. package/dist/migrate/legacy/three-db-cutover.js +841 -0
  287. package/dist/migrate/legacy/workflow-migrations-bodies.js +52 -0
  288. package/dist/migrate/legacy/workflow-migrations-frozen.js +21 -0
  289. package/dist/migrate/legacy-ref-grammar.js +209 -0
  290. package/dist/output/command-registry.js +27 -0
  291. package/dist/output/html-render.js +11 -16
  292. package/dist/output/renderers.js +32 -276
  293. package/dist/output/shapes/passthrough.js +3 -9
  294. package/dist/output/shapes/registry.js +12 -6
  295. package/dist/output/text/command-format.js +547 -0
  296. package/dist/output/text/helpers.js +15 -1377
  297. package/dist/output/text/proposal-format.js +230 -0
  298. package/dist/output/text/registry.js +12 -6
  299. package/dist/output/text/show-directives.js +107 -0
  300. package/dist/output/text/show-format.js +103 -0
  301. package/dist/output/text/workflow-format.js +345 -0
  302. package/dist/output/text.js +1 -3
  303. package/dist/registry/build-index.js +13 -17
  304. package/dist/registry/providers/static-index.js +2 -2
  305. package/dist/registry/resolve.js +4 -90
  306. package/dist/registry/semver.js +93 -0
  307. package/dist/runtime.js +90 -0
  308. package/dist/schemas/akm-config.json +2956 -14890
  309. package/dist/scripts/migrate-storage.js +2312 -19643
  310. package/dist/setup/detect.js +5 -7
  311. package/dist/setup/engine-config.js +2 -1
  312. package/dist/setup/registry-stash-loader.js +1 -1
  313. package/dist/setup/semantic-assets.js +12 -9
  314. package/dist/setup/setup.js +109 -39
  315. package/dist/setup/steps/connection-shared.js +120 -0
  316. package/dist/setup/steps/connection.js +50 -274
  317. package/dist/setup/steps/platforms.js +1 -0
  318. package/dist/setup/steps/sources.js +13 -6
  319. package/dist/setup/steps/stashdir.js +5 -2
  320. package/dist/sources/freshness.js +39 -0
  321. package/dist/sources/providers/git-provider.js +29 -33
  322. package/dist/sources/providers/git-stash.js +10 -5
  323. package/dist/sources/providers/provider-utils.js +40 -18
  324. package/dist/sources/providers/website.js +1 -1
  325. package/dist/sources/resolve.js +5 -5
  326. package/dist/sources/snapshot-fetchers/types.js +4 -0
  327. package/dist/sources/{website-ingest.js → snapshot-fetchers/website-ingest.js} +105 -39
  328. package/dist/storage/database.js +47 -3
  329. package/dist/storage/engines/sqlite-migrations.js +34 -16
  330. package/dist/storage/locations.js +1 -2
  331. package/dist/storage/repositories/improve-runs-repository.js +0 -20
  332. package/dist/storage/repositories/index-connection.js +80 -0
  333. package/dist/storage/repositories/index-db.js +4 -3
  334. package/dist/storage/repositories/index-entries-repository.js +952 -0
  335. package/dist/{indexer/db/entry-mapper.js → storage/repositories/index-entry-mapper.js} +15 -2
  336. package/dist/storage/repositories/index-entry-types.js +4 -0
  337. package/dist/storage/repositories/index-fts-repository.js +164 -0
  338. package/dist/storage/repositories/index-llm-cache-repository.js +109 -0
  339. package/dist/storage/repositories/index-meta-repository.js +50 -0
  340. package/dist/{indexer/db/schema.js → storage/repositories/index-schema.js} +241 -100
  341. package/dist/storage/repositories/index-sql.js +12 -0
  342. package/dist/storage/repositories/index-utility-repository.js +369 -0
  343. package/dist/storage/repositories/index-vec-repository.js +245 -0
  344. package/dist/storage/repositories/proposals-repository.js +41 -50
  345. package/dist/storage/repositories/registry-cache.js +1 -1
  346. package/dist/storage/repositories/workflow-runs-repository.js +17 -11
  347. package/dist/tasks/backends/cron.js +5 -5
  348. package/dist/tasks/backends/exec-utils.js +21 -0
  349. package/dist/tasks/backends/index.js +6 -9
  350. package/dist/tasks/backends/launchd.js +16 -17
  351. package/dist/tasks/backends/schtasks.js +33 -41
  352. package/dist/tasks/backends/types.js +4 -0
  353. package/dist/tasks/parser.js +25 -5
  354. package/dist/tasks/runner.js +33 -39
  355. package/dist/tasks/validator.js +5 -6
  356. package/dist/workflows/authoring/authoring.js +8 -11
  357. package/dist/workflows/exec/brief.js +10 -7
  358. package/dist/workflows/exec/report.js +261 -156
  359. package/dist/workflows/exec/run-workflow.js +2 -1
  360. package/dist/workflows/exec/step-work.js +3 -9
  361. package/dist/workflows/program/parser.js +4 -60
  362. package/dist/workflows/renderer.js +11 -60
  363. package/dist/workflows/runtime/checkin.js +1 -1
  364. package/dist/workflows/runtime/plan-classifier.js +7 -4
  365. package/dist/workflows/runtime/runs.js +11 -10
  366. package/dist/workflows/runtime/unit-checkin.js +1 -1
  367. package/dist/workflows/runtime/unit-phases.js +20 -0
  368. package/dist/workflows/runtime/workflow-asset-loader.js +27 -16
  369. package/dist/workflows/validate-summary.js +2 -2
  370. package/dist/workflows/validator.js +18 -2
  371. package/docs/migration/release-notes/0.9.0.md +45 -3
  372. package/docs/migration/v0.8-to-v0.9.md +466 -262
  373. package/docs/{data-and-telemetry.md → reference/data-and-telemetry.md} +61 -17
  374. package/package.json +10 -9
  375. package/schemas/akm-config.json +2956 -14890
  376. package/dist/assets/help/help-accept.md +0 -12
  377. package/dist/assets/help/help-improve.md +0 -87
  378. package/dist/assets/help/help-proposals.md +0 -17
  379. package/dist/assets/help/help-propose.md +0 -17
  380. package/dist/assets/help/help-reject.md +0 -11
  381. package/dist/assets/improve-strategies/recombine-only.json +0 -23
  382. package/dist/assets/improve-strategies/synthesize.json +0 -17
  383. package/dist/assets/prompts/procedural-system.md +0 -44
  384. package/dist/assets/prompts/recombine-system.md +0 -40
  385. package/dist/assets/prompts/staleness-detect-system.md +0 -6
  386. package/dist/assets/templates/html/default.html +0 -78
  387. package/dist/assets/templates/html/vendor/echarts.min.js +0 -45
  388. package/dist/assets/wiki/index-template.md +0 -12
  389. package/dist/assets/wiki/ingest-workflow-template.md +0 -83
  390. package/dist/assets/wiki/log-template.md +0 -8
  391. package/dist/assets/wiki/schema-template.md +0 -61
  392. package/dist/commands/improve/calibration.js +0 -161
  393. package/dist/commands/improve/dedup.js +0 -482
  394. package/dist/commands/improve/hot-probation.js +0 -45
  395. package/dist/commands/improve/improve-auto-accept.js +0 -262
  396. package/dist/commands/improve/procedural.js +0 -403
  397. package/dist/commands/improve/recombine.js +0 -843
  398. package/dist/commands/improve/schema-similarity-gate.js +0 -168
  399. package/dist/commands/lint/agent-linter.js +0 -44
  400. package/dist/commands/lint/command-linter.js +0 -44
  401. package/dist/commands/lint/default-linter.js +0 -16
  402. package/dist/commands/lint/fact-linter.js +0 -39
  403. package/dist/commands/lint/knowledge-linter.js +0 -16
  404. package/dist/commands/lint/memory-linter.js +0 -61
  405. package/dist/commands/lint/registry.js +0 -41
  406. package/dist/commands/lint/skill-linter.js +0 -45
  407. package/dist/commands/lint/task-linter.js +0 -50
  408. package/dist/commands/lint/workflow-linter.js +0 -81
  409. package/dist/commands/proposal/legacy-import.js +0 -115
  410. package/dist/commands/wiki-cli.js +0 -291
  411. package/dist/core/asset/asset-registry.js +0 -76
  412. package/dist/core/asset/asset-spec.js +0 -316
  413. package/dist/core/eval/rank-metrics.js +0 -113
  414. package/dist/core/ripgrep/install.js +0 -163
  415. package/dist/core/ripgrep/resolve.js +0 -81
  416. package/dist/indexer/db/db.js +0 -1585
  417. package/dist/indexer/manifest.js +0 -170
  418. package/dist/indexer/passes/metadata-contributors.js +0 -31
  419. package/dist/integrations/harnesses/opencode-sdk/index.js +0 -25
  420. package/dist/output/text/wiki.js +0 -16
  421. package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +0 -18229
  422. package/dist/scripts/migrations/v16-to-v17.js +0 -141
  423. package/dist/storage/repositories/consolidation-repository.js +0 -38
  424. package/dist/storage/repositories/recombine-repository.js +0 -213
  425. package/dist/wiki/wiki-templates.js +0 -15
  426. package/dist/wiki/wiki.js +0 -1013
  427. package/dist/workflows/db.js +0 -413
  428. package/docs/migration/release-notes/0.9.0-beta.60.md +0 -19
  429. /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/registry.js +0 -0
  430. /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/youtube.js +0 -0
@@ -42,6 +42,6 @@ Use a skill when the stash needs reusable procedural guidance for a recurring cl
42
42
  ## Placement & linking
43
43
 
44
44
  - Skills are **reuse-born**: place `skills/<domain>/<name>/SKILL.md` under a
45
- stable **domain** prefix from `fact:conventions/domains`
46
- (`skill:testing/flaky-test-triage`) so any project finds and reuses it instead
45
+ stable **domain** prefix from `facts/conventions/domains`
46
+ (`skills/testing/flaky-test-triage`) so any project finds and reuses it instead
47
47
  of duplicating the procedure.
@@ -45,5 +45,5 @@ Use a workflow when the task requires multiple steps, branching decisions, repea
45
45
  ## Placement & linking
46
46
 
47
47
  - Workflows are usually **global**: keep them at the type root or under a
48
- tool/domain slug (`workflow:release-train`). Scoping a workflow to one project
48
+ tool/domain slug (`workflows/release-train`). Scoping a workflow to one project
49
49
  rarely improves retrieval and adds rename risk.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  category: convention
3
3
  description: How to cross-link assets so retrieval compounds — a provenance xref when derived, sparse real associative xrefs, corrections as new assets, and canonical entity naming.
4
- when_to_use: Surfaced to authoring agents when they create or revise any non-wiki asset that derives from, corrects, or relates to another asset.
4
+ when_to_use: Surfaced to authoring agents when they create or revise any asset that derives from, corrects, or relates to another asset.
5
5
  ---
6
6
 
7
7
  <!--
@@ -9,8 +9,8 @@ when_to_use: Surfaced to authoring agents when they create or revise any non-wik
9
9
  mechanism, not decoration: `xrefs:` frontmatter folds into the search index;
10
10
  the entity/relation graph is extracted from BODY prose (memory + knowledge),
11
11
  never from frontmatter. Over-linking degrades ranking, so these rules are
12
- deliberately conservative. Wikis have their own xref + lint system — this
13
- convention is for non-wiki assets.
12
+ deliberately conservative. (LLM-wiki bundles carry their own xref system in
13
+ their pages' frontmatter — this convention is for in-stash assets.)
14
14
  -->
15
15
 
16
16
  # Back-linking conventions
@@ -26,36 +26,37 @@ lever — which means both too few and too many hurt.
26
26
  description: OAuth refresh-token race on token rotation
27
27
  tags: [auth, projectA]
28
28
  xrefs:
29
- - knowledge:auth/vendor-x-token-api # provenance: what this was synthesized from
30
- - lesson:projectA/token-refresh-gotcha # one real associative link
29
+ - knowledge/auth/vendor-x-token-api # provenance: what this was synthesized from
30
+ - lessons/projectA/token-refresh-gotcha # one real associative link
31
31
  ---
32
32
  ```
33
33
 
34
34
  ## Link rules
35
35
 
36
36
  - **One xref is mandatory when the asset derives from another: cite the source
37
- ref** (`memory:projectA/token-quirk` xrefs `knowledge:auth/vendor-x-token-api`
37
+ ref** (`memories/projectA/token-quirk` xrefs `knowledge/auth/vendor-x-token-api`
38
38
  — it also makes this asset findable from searches for its source). An
39
39
  original observation with no source carries none — never invent provenance.
40
40
  `akm remember`/`akm import` write this channel via `--xref <ref>`
41
- (repeatable; refs are checked at write time). Wikis enforce the analogous
42
- rule mechanically (`sources:` + `uncited-raw` lint); non-wiki provenance is
43
- discipline only.
41
+ (repeatable; refs are checked at write time). LLM-wiki bundles enforce the
42
+ analogous rule mechanically (`sources:` frontmatter citations); in-stash
43
+ provenance is discipline only.
44
44
  - **Associative xrefs are discretionary — real relationships only.** Add one when
45
45
  you already know a genuine load-bearing connection. Do **not** hit a link
46
46
  quota by pointing at the topically-nearest sibling — a plausible-but-wrong
47
47
  xref makes this asset a false search match for the other topic, and a wrong
48
48
  relationship asserted in prose poisons the entity graph. A relationship you
49
49
  want the graph to learn must be named in the body (e.g. open with "Corrects
50
- knowledge:auth/oauth-refresh-races").
50
+ knowledge/auth/oauth-refresh-races").
51
51
  - **Cap total xrefs at ~5 (a heuristic, not a measured threshold).** Each xref
52
52
  folds its ref tokens into THIS asset's search hints — past a handful, the
53
53
  asset matches queries about several other topics and its own ranking signal
54
54
  blurs.
55
- - **Corrections are new assets; ingested material is immutable.** Treat wiki
56
- `raw/`, vendored docs, and transcripts as immutable-by-discipline: a hard-won
57
- fix is a new `lesson:` or `knowledge:` asset that xrefs what it corrects.
58
- Synthesized `knowledge:` pages are the rewritable layer — update them in
55
+ - **Corrections are new assets; ingested material is immutable.** Treat
56
+ ingested raw material, vendored docs, and transcripts as
57
+ immutable-by-discipline: a hard-won fix is a new `lessons/` or `knowledge/`
58
+ asset that xrefs what it corrects.
59
+ Synthesized `knowledge/` pages are the rewritable layer — update them in
59
60
  place. When a correction supersedes a standalone asset (memory OR knowledge),
60
61
  also set the old asset's `beliefState: superseded` and
61
62
  `supersededBy: [<new ref>]` — a metadata edit, not a content edit — so the
@@ -78,14 +79,13 @@ open the body with a plain title plus a one-line
78
79
  orientation naming what it is, its scope/domain, and its key entities in
79
80
  canonical spelling (`Postgres`, `OAuth`, `TLS`, `Acme`) — the entity/relation
80
81
  graph is extracted from body prose, and readers land here from `akm show`.
81
- Keep the canonical-spelling list in `fact:conventions/domains` so agents don't
82
+ Keep the canonical-spelling list in `facts/conventions/domains` so agents don't
82
83
  fragment `postgres` / `postgresql` / `pg`.
83
84
 
84
85
  ## Hubs are optional, not per-namespace obligations
85
86
 
86
- A hub (a `wiki:` overview page that xrefs the key assets in a domain) is worth
87
- authoring for a **few genuinely high-traffic domains** wikis are the one type
88
- with real orphan/broken-xref/stale-index lint to keep a hub honest. Do **not**
87
+ A hub (a `knowledge/` overview page that xrefs the key assets in a domain) is
88
+ worth authoring for a **few genuinely high-traffic domains**. Do **not**
89
89
  mandate a hub per namespace and do not edit a hub on every write: that is O(n)
90
90
  maintenance, a concurrent-write contention point, and it flattens the multi-hop
91
91
  graph into a namespace-wide star. Let the FTS index be the catalog; spend the
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  category: convention
3
- description: The closed vocabulary of domain prefixes for reuse-born assets (knowledge/skill/wiki/fact/script), plus canonical entity spellings. Edit this to match your stash.
4
- when_to_use: Surfaced to authoring agents alongside the other convention facts; consult it when picking a domain prefix for a knowledge, skill, fact, or script asset (for wikis, the domain names the wiki).
3
+ description: The closed vocabulary of domain prefixes for reuse-born assets (knowledge/skill/fact/script), plus canonical entity spellings. Edit this to match your stash.
4
+ when_to_use: Surfaced to authoring agents alongside the other convention facts; consult it when picking a domain prefix for a knowledge, skill, fact, or script asset.
5
5
  ---
6
6
 
7
7
  <!--
@@ -14,10 +14,9 @@ when_to_use: Surfaced to authoring agents alongside the other convention facts;
14
14
 
15
15
  # Domain vocabulary
16
16
 
17
- Reuse-born assets (`knowledge`, `skill`, `wiki`, `fact`, `script`) take a
18
- **domain prefix** from this list, e.g. `knowledge:auth/oauth-refresh-races`,
19
- `skill:testing/flaky-test-triage` (for a wiki, the domain names the wiki:
20
- `wikis/auth/`). Pick the closest match. If two fit, take the one naming the
17
+ Reuse-born assets (`knowledge`, `skill`, `fact`, `script`) take a
18
+ **domain prefix** from this list, e.g. `knowledge/auth/oauth-refresh-races`,
19
+ `skills/testing/flaky-test-triage`. Pick the closest match. If two fit, take the one naming the
21
20
  SUBJECT of the doc (what it teaches, not where it was met) and put the other in
22
21
  tags; if still tied, the earlier entry in this list wins. If nothing fits, write
23
22
  the asset at the type root and propose an addition here — do **not** invent a
@@ -41,8 +40,8 @@ volume justifies it.
41
40
  - `frontend` — UI, rendering, client state
42
41
  - `data-pipelines` — ETL, streaming, batch processing
43
42
  - `tooling` — dev tooling, editor/agent integration, scripts
44
- - `policies` — organizational/business rules the work must obey (PII handling, licensing) (`fact:policies/…`)
45
- - `conventions` — stash authoring house-rules (`fact:conventions/…`; auto-surfaced to authoring agents — keep them in this directory)
43
+ - `policies` — organizational/business rules the work must obey (PII handling, licensing) (`facts/policies/…`)
44
+ - `conventions` — stash authoring house-rules (`facts/conventions/…`; auto-surfaced to authoring agents — keep them in this directory)
46
45
 
47
46
  ## Canonical entity spellings
48
47
 
@@ -57,7 +56,7 @@ fragment the entity graph. Extend as your stash grows.
57
56
 
58
57
  Project and client slugs are **not** listed here — those are scope slugs for
59
58
  scope-born types (`memory`, `lesson`, `task`, `env`, `secret`). Keep their
60
- canonical spellings in a `category: meta` fact (e.g. `fact:active-projects`) so
59
+ canonical spellings in a `category: meta` fact (e.g. `facts/active-projects`) so
61
60
  they auto-inject at authoring time — not in `.meta/`, which is unindexed and
62
61
  invisible mid-task — and `akm search` for an existing spelling before minting a
63
62
  new one.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  category: convention
3
3
  description: Where to place an asset in the stash — the one path partition axis, chosen by asset type, so refs stay stable and slug search (akm search "<slug>" --type <type>) co-locates related assets.
4
- when_to_use: Surfaced to authoring agents when they create or move any non-wiki asset and must decide its subdirectory/name.
4
+ when_to_use: Surfaced to authoring agents when they create or move any asset and must decide its subdirectory/name.
5
5
  ---
6
6
 
7
7
  <!--
@@ -14,7 +14,7 @@ when_to_use: Surfaced to authoring agents when they create or move any non-wiki
14
14
  # Stash organization conventions
15
15
 
16
16
  A file's path under its type directory **becomes part of its ref**
17
- (`knowledge/auth/oauth-refresh-races.md` → `knowledge:auth/oauth-refresh-races`).
17
+ (`knowledge/auth/oauth-refresh-races.md` → `knowledge/auth/oauth-refresh-races`).
18
18
  That ref is an address other assets cite, and its segments are search terms —
19
19
  `akm search "projectA" --type memory` reconstructs a project's memories. The
20
20
  path is therefore the one facet you **cannot express twice and cannot change
@@ -39,18 +39,16 @@ differently and bake the wrong guess into an immutable ref. Decide by type:
39
39
  `git remote`/package.json spell it) — ranking auto-boosts assets whose name
40
40
  or tags match the current repo. Client/team slugs get no such boost; just
41
41
  reuse the existing spelling.
42
- - `memory:projectA/auth-token-refresh`
43
- - `lesson:clientX/migration-rollback-gotcha`
44
- - `secret:clientX/api-key`
42
+ - `memories/projectA/auth-token-refresh`
43
+ - `lessons/clientX/migration-rollback-gotcha`
44
+ - `secrets/clientX/api-key`
45
45
  - **Reuse-born types → stable domain from a short vocabulary.**
46
- `knowledge`, `skill`, `wiki`, `fact`, `script`. These are meant to be reused
46
+ `knowledge`, `skill`, `fact`, `script`. These are meant to be reused
47
47
  across projects, so co-locate them by subject — any project retrieves them
48
- with `akm search "<domain>" --type <type>`. For a wiki the domain names the
49
- wiki itself (`wikis/auth/`); inside it, its `schema.md` and wiki lint govern
50
- layout, not these rules.
51
- - `knowledge:auth/oauth-refresh-races`
52
- - `skill:testing/flaky-test-triage`
53
- - `fact:policies/pii-handling`
48
+ with `akm search "<domain>" --type <type>`.
49
+ - `knowledge/auth/oauth-refresh-races`
50
+ - `skills/testing/flaky-test-triage`
51
+ - `facts/policies/pii-handling`
54
52
  - **Global-by-nature types → type root or a tool slug.**
55
53
  `command`, `agent`, `workflow`, and stash-wide `env`. Scoping these to a
56
54
  project rarely improves precision and only adds rename risk. `env` defaults
@@ -78,13 +76,13 @@ cross-project reuse.
78
76
  author, `wip`/`done`. Each one changes and forces a ref-breaking rename. They
79
77
  belong in frontmatter tags.
80
78
  - **Flat fallback beats an invented folder.** If no domain fits a reuse-type
81
- asset, write it at the type root (`knowledge:http-retry-basics`) rather than
79
+ asset, write it at the type root (`knowledge/http-retry-basics`) rather than
82
80
  coining a one-off domain. An unneeded folder is pure rename liability; propose
83
81
  a vocabulary addition instead of fragmenting the tree.
84
82
  - **Reuse an existing slug before minting a new one.** Before coining a new
85
83
  project/client/domain slug, `akm search` for the existing spelling
86
84
  (`acme` vs `acme-corp`) so the prefix does not fragment. Keep the domain
87
- vocabulary in `fact:conventions/domains`.
85
+ vocabulary in `facts/conventions/domains`.
88
86
  - **Off-axis facets go in `tags:`, not a bare field.** The indexed FTS fields are
89
87
  name, description, tags, hints, and content (headings only — body prose is
90
88
  not indexed by default; the opt-in `index.indexBodyOpening` flag adds just
@@ -115,7 +113,7 @@ cross-project reuse.
115
113
  xref-fixing operation: grep the stash for the old ref string and fix every
116
114
  inbound reference in the same pass.
117
115
  - When a project-scoped note turns out to be domain-general, **append, don't
118
- promote**: write a new `knowledge:<domain>/…` asset that xrefs the originating
116
+ promote**: write a new `knowledge/<domain>/…` asset that xrefs the originating
119
117
  memory. Never rename the memory up a rung — that breaks its ref. The atomic
120
118
  note still serves factoid recall; the new synthesis serves reuse; the xref
121
119
  bridges them.
@@ -1,5 +1,5 @@
1
1
  version: 2
2
2
  schedule: "*/30 * * * *"
3
- command: akm extract
3
+ command: akm extract --auto
4
4
  enabled: true
5
- description: Extract insights from session files every 30 min
5
+ description: Opt-in all-harness session extraction every 30 min
@@ -1,5 +1,5 @@
1
1
  version: 2
2
2
  schedule: "0 2 * * *"
3
- command: akm improve --auto-accept safe
3
+ command: akm improve
4
4
  enabled: true
5
5
  description: Run improve pipeline nightly
@@ -4,9 +4,8 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>%%REPORT_TITLE%%</title>
7
- <!-- %%ECHARTS_TAG%% : either an inlined <script>…echarts…</script> (self-contained
8
- / deterministic / offline) or a CDN <script src> when the renderer is run
9
- with --echarts cdn. -->
7
+ <!-- %%ECHARTS_TAG%% : a <script src> pointed at the jsDelivr CDN (chunk-9
8
+ WI-9.4d) viewing this report requires network access. -->
10
9
  %%ECHARTS_TAG%%
11
10
  <style>
12
11
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }