akm-cli 0.7.0 → 0.7.2

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 (332) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{src/cli.js → cli.js} +22 -8
  3. package/dist/{src/commands → commands}/installed-stashes.js +1 -1
  4. package/dist/{src/commands → commands}/source-add.js +1 -1
  5. package/dist/{src/core → core}/common.js +16 -1
  6. package/dist/{src/core → core}/config.js +5 -2
  7. package/dist/{src/indexer → indexer}/db-search.js +16 -1
  8. package/dist/{src/indexer → indexer}/graph-extraction.js +5 -3
  9. package/dist/{src/indexer → indexer}/indexer.js +27 -11
  10. package/dist/{src/indexer → indexer}/memory-inference.js +47 -58
  11. package/dist/{src/indexer → indexer}/search-source.js +1 -1
  12. package/dist/{src/llm → llm}/client.js +61 -1
  13. package/dist/{src/llm → llm}/embedder.js +8 -5
  14. package/dist/{src/llm → llm}/embedders/local.js +8 -2
  15. package/dist/{src/llm → llm}/embedders/remote.js +4 -2
  16. package/dist/{src/llm → llm}/graph-extract.js +4 -4
  17. package/dist/llm/memory-infer.js +114 -0
  18. package/dist/{src/llm → llm}/metadata-enhance.js +2 -2
  19. package/dist/{src/output → output}/cli-hints.js +2 -0
  20. package/dist/{src/setup → setup}/setup.js +30 -20
  21. package/dist/sources/providers/website.js +27 -0
  22. package/dist/{src/sources/providers/website.js → sources/website-ingest.js} +38 -51
  23. package/docs/README.md +7 -0
  24. package/docs/migration/release-notes/0.7.0.md +14 -0
  25. package/package.json +11 -8
  26. package/dist/src/llm/memory-infer.js +0 -86
  27. package/dist/tests/add-website-source.test.js +0 -119
  28. package/dist/tests/agent/agent-config-loader.test.js +0 -70
  29. package/dist/tests/agent/agent-config.test.js +0 -221
  30. package/dist/tests/agent/agent-detect.test.js +0 -100
  31. package/dist/tests/agent/agent-spawn.test.js +0 -234
  32. package/dist/tests/agent-output.test.js +0 -186
  33. package/dist/tests/architecture/agent-no-llm-sdk-guard.test.js +0 -103
  34. package/dist/tests/architecture/agent-spawn-seam.test.js +0 -193
  35. package/dist/tests/architecture/llm-stateless-seam.test.js +0 -112
  36. package/dist/tests/asset-ref.test.js +0 -192
  37. package/dist/tests/asset-registry.test.js +0 -103
  38. package/dist/tests/asset-spec.test.js +0 -241
  39. package/dist/tests/bench/attribution.test.js +0 -996
  40. package/dist/tests/bench/cleanup-sigint.test.js +0 -83
  41. package/dist/tests/bench/cleanup.js +0 -234
  42. package/dist/tests/bench/cleanup.test.js +0 -166
  43. package/dist/tests/bench/cli.js +0 -1018
  44. package/dist/tests/bench/cli.test.js +0 -445
  45. package/dist/tests/bench/compare.test.js +0 -556
  46. package/dist/tests/bench/corpus.js +0 -317
  47. package/dist/tests/bench/corpus.test.js +0 -258
  48. package/dist/tests/bench/doctor.js +0 -525
  49. package/dist/tests/bench/driver.js +0 -401
  50. package/dist/tests/bench/driver.test.js +0 -584
  51. package/dist/tests/bench/environment.js +0 -233
  52. package/dist/tests/bench/environment.test.js +0 -199
  53. package/dist/tests/bench/evolve-metrics.js +0 -179
  54. package/dist/tests/bench/evolve-metrics.test.js +0 -187
  55. package/dist/tests/bench/evolve.js +0 -647
  56. package/dist/tests/bench/evolve.test.js +0 -624
  57. package/dist/tests/bench/failure-modes.test.js +0 -349
  58. package/dist/tests/bench/feedback-integrity.test.js +0 -457
  59. package/dist/tests/bench/leakage.test.js +0 -228
  60. package/dist/tests/bench/learning-curve.test.js +0 -134
  61. package/dist/tests/bench/metrics.js +0 -2395
  62. package/dist/tests/bench/metrics.test.js +0 -1150
  63. package/dist/tests/bench/no-os-tmpdir-invariant.test.js +0 -43
  64. package/dist/tests/bench/opencode-config.js +0 -194
  65. package/dist/tests/bench/opencode-config.test.js +0 -370
  66. package/dist/tests/bench/report.js +0 -1885
  67. package/dist/tests/bench/report.test.js +0 -1038
  68. package/dist/tests/bench/run-config.js +0 -355
  69. package/dist/tests/bench/run-config.test.js +0 -298
  70. package/dist/tests/bench/run-curate-test.js +0 -32
  71. package/dist/tests/bench/run-failing-tasks.js +0 -56
  72. package/dist/tests/bench/run-full-bench.js +0 -51
  73. package/dist/tests/bench/run-items36-targeted.js +0 -69
  74. package/dist/tests/bench/run-nano-quick.js +0 -42
  75. package/dist/tests/bench/run-waveg-targeted.js +0 -62
  76. package/dist/tests/bench/runner.js +0 -699
  77. package/dist/tests/bench/runner.test.js +0 -958
  78. package/dist/tests/bench/search-bridge.test.js +0 -331
  79. package/dist/tests/bench/tmp.js +0 -131
  80. package/dist/tests/bench/trajectory.js +0 -116
  81. package/dist/tests/bench/trajectory.test.js +0 -127
  82. package/dist/tests/bench/verifier.js +0 -114
  83. package/dist/tests/bench/verifier.test.js +0 -118
  84. package/dist/tests/bench/workflow-evaluator.js +0 -557
  85. package/dist/tests/bench/workflow-evaluator.test.js +0 -421
  86. package/dist/tests/bench/workflow-spec.js +0 -345
  87. package/dist/tests/bench/workflow-spec.test.js +0 -363
  88. package/dist/tests/bench/workflow-trace.js +0 -472
  89. package/dist/tests/bench/workflow-trace.test.js +0 -254
  90. package/dist/tests/benchmark-search-quality.js +0 -536
  91. package/dist/tests/benchmark-suite.js +0 -1441
  92. package/dist/tests/capture-cli.test.js +0 -112
  93. package/dist/tests/cli-errors.test.js +0 -204
  94. package/dist/tests/commands/events.test.js +0 -370
  95. package/dist/tests/commands/history.test.js +0 -418
  96. package/dist/tests/commands/import.test.js +0 -103
  97. package/dist/tests/commands/proposal-cli.test.js +0 -209
  98. package/dist/tests/commands/reflect-propose-cli.test.js +0 -333
  99. package/dist/tests/commands/remember.test.js +0 -97
  100. package/dist/tests/commands/scope-flags.test.js +0 -300
  101. package/dist/tests/commands/search.test.js +0 -537
  102. package/dist/tests/commands/show-indexer-parity.test.js +0 -117
  103. package/dist/tests/commands/show.test.js +0 -294
  104. package/dist/tests/common.test.js +0 -266
  105. package/dist/tests/completions.test.js +0 -142
  106. package/dist/tests/config-cli.test.js +0 -193
  107. package/dist/tests/config-llm-features.test.js +0 -139
  108. package/dist/tests/config.test.js +0 -569
  109. package/dist/tests/contracts/migration-baseline.test.js +0 -43
  110. package/dist/tests/contracts/reflect-propose-envelope.test.js +0 -139
  111. package/dist/tests/contracts/spec-helpers.js +0 -46
  112. package/dist/tests/contracts/v1-spec-section-11-proposal-queue.test.js +0 -228
  113. package/dist/tests/contracts/v1-spec-section-12-agent-config.test.js +0 -56
  114. package/dist/tests/contracts/v1-spec-section-13-lesson-type.test.js +0 -34
  115. package/dist/tests/contracts/v1-spec-section-14-llm-features.test.js +0 -94
  116. package/dist/tests/contracts/v1-spec-section-4-1-asset-types.test.js +0 -39
  117. package/dist/tests/contracts/v1-spec-section-4-2-quality-rules.test.js +0 -44
  118. package/dist/tests/contracts/v1-spec-section-5-configuration.test.js +0 -47
  119. package/dist/tests/contracts/v1-spec-section-6-orchestration.test.js +0 -40
  120. package/dist/tests/contracts/v1-spec-section-7-module-layout.test.js +0 -58
  121. package/dist/tests/contracts/v1-spec-section-8-extension-points.test.js +0 -34
  122. package/dist/tests/contracts/v1-spec-section-9-4-cli-surface.test.js +0 -75
  123. package/dist/tests/contracts/v1-spec-section-9-7-llm-agent-boundary.test.js +0 -36
  124. package/dist/tests/core/write-source.test.js +0 -366
  125. package/dist/tests/curate-command.test.js +0 -87
  126. package/dist/tests/db-scoring.test.js +0 -201
  127. package/dist/tests/db.test.js +0 -654
  128. package/dist/tests/distill-cli-flag.test.js +0 -208
  129. package/dist/tests/distill.test.js +0 -515
  130. package/dist/tests/docker-install.test.js +0 -120
  131. package/dist/tests/e2e.test.js +0 -1419
  132. package/dist/tests/embedder.test.js +0 -340
  133. package/dist/tests/embedding-model-config.test.js +0 -379
  134. package/dist/tests/feedback-command.test.js +0 -172
  135. package/dist/tests/file-context.test.js +0 -552
  136. package/dist/tests/fixtures/scripts/git/summarize-diff.js +0 -9
  137. package/dist/tests/fixtures/scripts/lint/eslint-check.js +0 -7
  138. package/dist/tests/fixtures/stashes/load.js +0 -166
  139. package/dist/tests/fixtures/stashes/load.test.js +0 -97
  140. package/dist/tests/fixtures/stashes/ranking-baseline/scripts/mem0-search.js +0 -12
  141. package/dist/tests/frontmatter.test.js +0 -190
  142. package/dist/tests/fts-field-weighting.test.js +0 -254
  143. package/dist/tests/fuzzy-search.test.js +0 -230
  144. package/dist/tests/git-provider-clone.test.js +0 -45
  145. package/dist/tests/github.test.js +0 -161
  146. package/dist/tests/graph-boost-ranking.test.js +0 -305
  147. package/dist/tests/graph-extraction.test.js +0 -282
  148. package/dist/tests/helpers/usage-events.js +0 -8
  149. package/dist/tests/index-pass-llm.test.js +0 -161
  150. package/dist/tests/indexer.test.js +0 -570
  151. package/dist/tests/info-command.test.js +0 -166
  152. package/dist/tests/init.test.js +0 -69
  153. package/dist/tests/install-script.test.js +0 -246
  154. package/dist/tests/integration/agent-real-profile.test.js +0 -94
  155. package/dist/tests/issue-36-repro.test.js +0 -304
  156. package/dist/tests/issues-191-194.test.js +0 -160
  157. package/dist/tests/lesson-lint.test.js +0 -111
  158. package/dist/tests/llm-client.test.js +0 -115
  159. package/dist/tests/llm-feature-gate.test.js +0 -151
  160. package/dist/tests/llm.test.js +0 -139
  161. package/dist/tests/lockfile.test.js +0 -216
  162. package/dist/tests/manifest.test.js +0 -205
  163. package/dist/tests/markdown.test.js +0 -126
  164. package/dist/tests/matchers-unit.test.js +0 -189
  165. package/dist/tests/memory-inference.test.js +0 -299
  166. package/dist/tests/merge-scoring.test.js +0 -136
  167. package/dist/tests/metadata.test.js +0 -313
  168. package/dist/tests/migration-help.test.js +0 -89
  169. package/dist/tests/origin-resolve.test.js +0 -124
  170. package/dist/tests/output-baseline.test.js +0 -218
  171. package/dist/tests/output-shapes-unit.test.js +0 -478
  172. package/dist/tests/parallel-search.test.js +0 -272
  173. package/dist/tests/parameter-metadata.test.js +0 -365
  174. package/dist/tests/paths.test.js +0 -177
  175. package/dist/tests/progressive-disclosure.test.js +0 -280
  176. package/dist/tests/proposals.test.js +0 -279
  177. package/dist/tests/proposed-quality.test.js +0 -271
  178. package/dist/tests/provider-registry.test.js +0 -32
  179. package/dist/tests/ranking-regression.test.js +0 -548
  180. package/dist/tests/reflect-propose.test.js +0 -455
  181. package/dist/tests/registry-build-index.test.js +0 -394
  182. package/dist/tests/registry-cli.test.js +0 -290
  183. package/dist/tests/registry-index-v2.test.js +0 -430
  184. package/dist/tests/registry-install.test.js +0 -728
  185. package/dist/tests/registry-providers/parity.test.js +0 -189
  186. package/dist/tests/registry-providers/skills-sh.test.js +0 -309
  187. package/dist/tests/registry-providers/static-index.test.js +0 -238
  188. package/dist/tests/registry-resolve.test.js +0 -126
  189. package/dist/tests/registry-search.test.js +0 -923
  190. package/dist/tests/remember-frontmatter.test.js +0 -378
  191. package/dist/tests/remember-unit.test.js +0 -123
  192. package/dist/tests/ripgrep-install.test.js +0 -251
  193. package/dist/tests/ripgrep-resolve.test.js +0 -108
  194. package/dist/tests/ripgrep.test.js +0 -163
  195. package/dist/tests/save-command.test.js +0 -94
  196. package/dist/tests/save-trust-qa-fixes.test.js +0 -270
  197. package/dist/tests/scoring-pipeline.test.js +0 -648
  198. package/dist/tests/search-include-proposed-cli.test.js +0 -118
  199. package/dist/tests/self-update.test.js +0 -442
  200. package/dist/tests/semantic-search-e2e.test.js +0 -512
  201. package/dist/tests/semantic-status.test.js +0 -471
  202. package/dist/tests/setup-run.integration.js +0 -877
  203. package/dist/tests/setup-wizard.test.js +0 -198
  204. package/dist/tests/setup.test.js +0 -131
  205. package/dist/tests/source-add.test.js +0 -11
  206. package/dist/tests/source-clone.test.js +0 -254
  207. package/dist/tests/source-manage.test.js +0 -366
  208. package/dist/tests/source-providers/filesystem.test.js +0 -82
  209. package/dist/tests/source-providers/git.test.js +0 -252
  210. package/dist/tests/source-providers/website.test.js +0 -128
  211. package/dist/tests/source-qa-fixes.test.js +0 -286
  212. package/dist/tests/source-registry.test.js +0 -350
  213. package/dist/tests/source-resolve.test.js +0 -100
  214. package/dist/tests/source-source.test.js +0 -281
  215. package/dist/tests/source.test.js +0 -533
  216. package/dist/tests/tar-utils-scan.test.js +0 -73
  217. package/dist/tests/toggle-components.test.js +0 -73
  218. package/dist/tests/usage-telemetry.test.js +0 -265
  219. package/dist/tests/utility-scoring.test.js +0 -558
  220. package/dist/tests/vault-load-error.test.js +0 -78
  221. package/dist/tests/vault-qa-fixes.test.js +0 -194
  222. package/dist/tests/vault.test.js +0 -429
  223. package/dist/tests/vector-search.test.js +0 -608
  224. package/dist/tests/walker.test.js +0 -252
  225. package/dist/tests/wave2-cluster-bc.test.js +0 -228
  226. package/dist/tests/wave2-cluster-d.test.js +0 -180
  227. package/dist/tests/wave2-cluster-e.test.js +0 -179
  228. package/dist/tests/wiki-qa-fixes.test.js +0 -270
  229. package/dist/tests/wiki.test.js +0 -529
  230. package/dist/tests/workflow-cli.test.js +0 -271
  231. package/dist/tests/workflow-markdown.test.js +0 -171
  232. package/dist/tests/workflow-path-escape.test.js +0 -132
  233. package/dist/tests/workflow-qa-fixes.test.js +0 -395
  234. package/dist/tests/workflows/indexer-rejection.test.js +0 -213
  235. /package/dist/{src/commands → commands}/completions.js +0 -0
  236. /package/dist/{src/commands → commands}/config-cli.js +0 -0
  237. /package/dist/{src/commands → commands}/curate.js +0 -0
  238. /package/dist/{src/commands → commands}/distill.js +0 -0
  239. /package/dist/{src/commands → commands}/events.js +0 -0
  240. /package/dist/{src/commands → commands}/history.js +0 -0
  241. /package/dist/{src/commands → commands}/info.js +0 -0
  242. /package/dist/{src/commands → commands}/init.js +0 -0
  243. /package/dist/{src/commands → commands}/install-audit.js +0 -0
  244. /package/dist/{src/commands → commands}/migration-help.js +0 -0
  245. /package/dist/{src/commands → commands}/proposal.js +0 -0
  246. /package/dist/{src/commands → commands}/propose.js +0 -0
  247. /package/dist/{src/commands → commands}/reflect.js +0 -0
  248. /package/dist/{src/commands → commands}/registry-search.js +0 -0
  249. /package/dist/{src/commands → commands}/remember.js +0 -0
  250. /package/dist/{src/commands → commands}/search.js +0 -0
  251. /package/dist/{src/commands → commands}/self-update.js +0 -0
  252. /package/dist/{src/commands → commands}/show.js +0 -0
  253. /package/dist/{src/commands → commands}/source-clone.js +0 -0
  254. /package/dist/{src/commands → commands}/source-manage.js +0 -0
  255. /package/dist/{src/commands → commands}/vault.js +0 -0
  256. /package/dist/{src/core → core}/asset-ref.js +0 -0
  257. /package/dist/{src/core → core}/asset-registry.js +0 -0
  258. /package/dist/{src/core → core}/asset-spec.js +0 -0
  259. /package/dist/{src/core → core}/errors.js +0 -0
  260. /package/dist/{src/core → core}/events.js +0 -0
  261. /package/dist/{src/core → core}/frontmatter.js +0 -0
  262. /package/dist/{src/core → core}/lesson-lint.js +0 -0
  263. /package/dist/{src/core → core}/markdown.js +0 -0
  264. /package/dist/{src/core → core}/paths.js +0 -0
  265. /package/dist/{src/core → core}/proposals.js +0 -0
  266. /package/dist/{src/core → core}/warn.js +0 -0
  267. /package/dist/{src/core → core}/write-source.js +0 -0
  268. /package/dist/{src/indexer → indexer}/db.js +0 -0
  269. /package/dist/{src/indexer → indexer}/file-context.js +0 -0
  270. /package/dist/{src/indexer → indexer}/graph-boost.js +0 -0
  271. /package/dist/{src/indexer → indexer}/manifest.js +0 -0
  272. /package/dist/{src/indexer → indexer}/matchers.js +0 -0
  273. /package/dist/{src/indexer → indexer}/metadata.js +0 -0
  274. /package/dist/{src/indexer → indexer}/search-fields.js +0 -0
  275. /package/dist/{src/indexer → indexer}/semantic-status.js +0 -0
  276. /package/dist/{src/indexer → indexer}/usage-events.js +0 -0
  277. /package/dist/{src/indexer → indexer}/walker.js +0 -0
  278. /package/dist/{src/integrations → integrations}/agent/config.js +0 -0
  279. /package/dist/{src/integrations → integrations}/agent/detect.js +0 -0
  280. /package/dist/{src/integrations → integrations}/agent/index.js +0 -0
  281. /package/dist/{src/integrations → integrations}/agent/profiles.js +0 -0
  282. /package/dist/{src/integrations → integrations}/agent/prompts.js +0 -0
  283. /package/dist/{src/integrations → integrations}/agent/spawn.js +0 -0
  284. /package/dist/{src/integrations → integrations}/github.js +0 -0
  285. /package/dist/{src/integrations → integrations}/lockfile.js +0 -0
  286. /package/dist/{src/llm → llm}/embedders/cache.js +0 -0
  287. /package/dist/{src/llm → llm}/embedders/types.js +0 -0
  288. /package/dist/{src/llm → llm}/feature-gate.js +0 -0
  289. /package/dist/{src/llm → llm}/index-passes.js +0 -0
  290. /package/dist/{src/output → output}/context.js +0 -0
  291. /package/dist/{src/output → output}/renderers.js +0 -0
  292. /package/dist/{src/output → output}/shapes.js +0 -0
  293. /package/dist/{src/output → output}/text.js +0 -0
  294. /package/dist/{src/registry → registry}/build-index.js +0 -0
  295. /package/dist/{src/registry → registry}/create-provider-registry.js +0 -0
  296. /package/dist/{src/registry → registry}/factory.js +0 -0
  297. /package/dist/{src/registry → registry}/origin-resolve.js +0 -0
  298. /package/dist/{src/registry → registry}/providers/index.js +0 -0
  299. /package/dist/{src/registry → registry}/providers/skills-sh.js +0 -0
  300. /package/dist/{src/registry → registry}/providers/static-index.js +0 -0
  301. /package/dist/{src/registry → registry}/providers/types.js +0 -0
  302. /package/dist/{src/registry → registry}/resolve.js +0 -0
  303. /package/dist/{src/registry → registry}/types.js +0 -0
  304. /package/dist/{src/setup → setup}/detect.js +0 -0
  305. /package/dist/{src/setup → setup}/ripgrep-install.js +0 -0
  306. /package/dist/{src/setup → setup}/ripgrep-resolve.js +0 -0
  307. /package/dist/{src/setup → setup}/steps.js +0 -0
  308. /package/dist/{src/sources → sources}/include.js +0 -0
  309. /package/dist/{src/sources → sources}/provider-factory.js +0 -0
  310. /package/dist/{src/sources → sources}/provider.js +0 -0
  311. /package/dist/{src/sources → sources}/providers/filesystem.js +0 -0
  312. /package/dist/{src/sources → sources}/providers/git.js +0 -0
  313. /package/dist/{src/sources → sources}/providers/index.js +0 -0
  314. /package/dist/{src/sources → sources}/providers/install-types.js +0 -0
  315. /package/dist/{src/sources → sources}/providers/npm.js +0 -0
  316. /package/dist/{src/sources → sources}/providers/provider-utils.js +0 -0
  317. /package/dist/{src/sources → sources}/providers/sync-from-ref.js +0 -0
  318. /package/dist/{src/sources → sources}/providers/tar-utils.js +0 -0
  319. /package/dist/{src/sources → sources}/resolve.js +0 -0
  320. /package/dist/{src/sources → sources}/types.js +0 -0
  321. /package/dist/{src/templates → templates}/wiki-templates.js +0 -0
  322. /package/dist/{src/version.js → version.js} +0 -0
  323. /package/dist/{src/wiki → wiki}/wiki.js +0 -0
  324. /package/dist/{src/workflows → workflows}/authoring.js +0 -0
  325. /package/dist/{src/workflows → workflows}/cli.js +0 -0
  326. /package/dist/{src/workflows → workflows}/db.js +0 -0
  327. /package/dist/{src/workflows → workflows}/document-cache.js +0 -0
  328. /package/dist/{src/workflows → workflows}/parser.js +0 -0
  329. /package/dist/{src/workflows → workflows}/renderer.js +0 -0
  330. /package/dist/{src/workflows → workflows}/runs.js +0 -0
  331. /package/dist/{src/workflows → workflows}/schema.js +0 -0
  332. /package/dist/{src/workflows → workflows}/validator.js +0 -0
@@ -1,44 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §4.2 — Asset quality rules (open set, default-filtered).
4
- //
5
- // The freeze rule is:
6
- // * `generated` and `curated` are well-known and included in default search.
7
- // * `proposed` is well-known and excluded from default search; surfaced via
8
- // `--include-proposed` or `akm proposal *`.
9
- // * Unknown values parse, warn, and remain searchable.
10
- describe("v1 spec §4.2 — asset quality rules", () => {
11
- const spec = readDoc(SPEC_PATH);
12
- const section = extractSection(spec, "### 4.2 Asset quality rules");
13
- test("§4.2 exists in the spec", () => {
14
- expect(section).not.toBe("");
15
- });
16
- test("§4.2 names the three well-known quality values", () => {
17
- expect(section).toContain('"generated"');
18
- expect(section).toContain('"curated"');
19
- expect(section).toContain('"proposed"');
20
- });
21
- test("§4.2 declares `proposed` is excluded from default search", () => {
22
- // Either phrasing is fine; we want both pieces of the rule present.
23
- expect(section).toMatch(/Excluded from default search/i);
24
- expect(section).toMatch(/--include-proposed|akm proposal/);
25
- });
26
- test("§4.2 names the `--include-proposed` opt-in flag explicitly", () => {
27
- // Locked CLI surface — this flag is the single way to surface
28
- // `proposed`-quality rows from `akm search` without going through
29
- // `akm proposal *`. Renaming is a major bump.
30
- expect(section).toContain("--include-proposed");
31
- });
32
- test("§4.2 declares unknown quality values parse-warn-include", () => {
33
- expect(section).toMatch(/Unknown quality values/i);
34
- expect(section).toMatch(/parse,?\s*warn/i);
35
- });
36
- test("§4.2 declares the legacy registry `curated` boolean is removed", () => {
37
- expect(section).toMatch(/legacy registry boolean `curated`/i);
38
- expect(section).toMatch(/parses and ignores/i);
39
- });
40
- test("§4.2 names the new optional SearchHit fields", () => {
41
- expect(section).toContain("quality?");
42
- expect(section).toContain("warnings?");
43
- });
44
- });
@@ -1,47 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §5 — Configuration.
4
- //
5
- // The freeze rule:
6
- // * The JSON schema names `sources[]`, `registries[]`, `embedder`, `scorer`,
7
- // `agent` (Planned), `llm` + `llm.features` (Planned), and
8
- // `defaultWriteTarget`.
9
- // * Value forms: literal or `{ env: "VAR" }`.
10
- // * `writable: true` is rejected on `website` / `npm`.
11
- // * Per-provider option schemas validate at config-load time.
12
- describe("v1 spec §5 — configuration", () => {
13
- const spec = readDoc(SPEC_PATH);
14
- const section = extractSection(spec, "## 5. Configuration");
15
- test("§5 exists in the spec", () => {
16
- expect(section).not.toBe("");
17
- });
18
- test("§5.1 names every locked top-level config key", () => {
19
- expect(section).toContain('"sources"');
20
- expect(section).toContain('"registries"');
21
- expect(section).toContain('"embedder"');
22
- expect(section).toContain('"scorer"');
23
- expect(section).toContain('"agent"');
24
- expect(section).toContain('"llm"');
25
- expect(section).toContain('"features"');
26
- expect(section).toContain('"defaultWriteTarget"');
27
- });
28
- test("§5.2 declares the literal-or-env value form", () => {
29
- expect(section).toMatch(/literal/i);
30
- expect(section).toMatch(/\{\s*"env":\s*"VAR_NAME"\s*\}/);
31
- expect(section).toMatch(/Missing required env vars produce `ConfigError`/i);
32
- });
33
- test("§5.3 declares per-provider option JSON schemas validated at load", () => {
34
- expect(section).toMatch(/JSON Schema/);
35
- expect(section).toMatch(/Missing required fields fail at load/i);
36
- });
37
- test("§5.4 declares the `writable` defaults and rejection rule", () => {
38
- expect(section).toMatch(/`true`\s*for\s*`filesystem`/);
39
- expect(section).toMatch(/`false`\s*for everything else/);
40
- expect(section).toMatch(/rejected at config load.*for `website` and `npm`/s);
41
- expect(section).toContain("ConfigError");
42
- });
43
- test("§5 stops before §6 (helper boundary check)", () => {
44
- expect(section).not.toContain("## 6.");
45
- expect(section).not.toContain("## 7.");
46
- });
47
- });
@@ -1,40 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §6 — Orchestration.
4
- //
5
- // The freeze rule:
6
- // * search → indexer.search(q); registry hits never merge into source hits.
7
- // * show → indexer.lookup(ref) then read file from disk.
8
- // * remember/import target resolution: --target → defaultWriteTarget →
9
- // working stash → ConfigError.
10
- // * `index.db` is ephemeral; `usage_events` is preserved across schema bumps.
11
- describe("v1 spec §6 — orchestration", () => {
12
- const spec = readDoc(SPEC_PATH);
13
- const section = extractSection(spec, "## 6. Orchestration");
14
- test("§6 exists in the spec", () => {
15
- expect(section).not.toBe("");
16
- });
17
- test("§6.1 says search uses indexer.search and registry hits stay separate", () => {
18
- expect(section).toMatch(/indexer\.search/);
19
- expect(section).toMatch(/--include-registry/);
20
- expect(section).toMatch(/never merge into source hits/i);
21
- });
22
- test("§6.2 says show uses indexer.lookup and reads the file from disk", () => {
23
- expect(section).toMatch(/indexer\.lookup/);
24
- expect(section).toMatch(/readFile/);
25
- });
26
- test("§6.5 declares the write-target resolution order", () => {
27
- const flat = section.replace(/\s+/g, " ");
28
- expect(flat).toMatch(/--target.*defaultWriteTarget.*working stash.*ConfigError/);
29
- expect(section).toMatch(/akm init/);
30
- });
31
- test("§6.7 declares index.db is ephemeral and usage_events is preserved", () => {
32
- expect(section).toMatch(/index\.db.*ephemeral/i);
33
- expect(section).toMatch(/preserving `usage_events`/);
34
- expect(section).toMatch(/workflow\.db.*never\s*touched/i);
35
- });
36
- test("§6 stops before §7 (helper boundary check)", () => {
37
- expect(section).not.toContain("## 7.");
38
- expect(section).not.toContain("## 8.");
39
- });
40
- });
@@ -1,58 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import fs from "node:fs";
3
- import path from "node:path";
4
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
5
- // Pins v1 spec §7 — Module layout.
6
- //
7
- // We don't enforce the literal tree the spec sketches (the spec uses a
8
- // schematic, the actual tree has more files). We DO enforce the named
9
- // anchor modules — moving or renaming any of these is a contract change.
10
- // The spec's §7 schematic uses idealized names (`refs.ts`, `types.ts`); the
11
- // shipped tree has slightly different file names but the same concepts. We
12
- // pin the actually-shipped anchors — moving any of these is a real
13
- // contract change, not a rename of a doc-only schematic.
14
- const REQUIRED_FILES = [
15
- "src/cli.ts",
16
- "src/core/asset-ref.ts",
17
- "src/core/errors.ts",
18
- "src/core/config.ts",
19
- "src/core/write-source.ts",
20
- ];
21
- const REQUIRED_DIRS = ["src/commands", "src/sources", "src/registry", "src/indexer", "src/output"];
22
- const repoRoot = path.resolve(import.meta.dir, "..", "..");
23
- describe("v1 spec §7 — module layout", () => {
24
- const spec = readDoc(SPEC_PATH);
25
- const section = extractSection(spec, "## 7. Module layout");
26
- test("§7 exists in the spec", () => {
27
- expect(section).not.toBe("");
28
- });
29
- test("§7 names the locked anchor modules in the schematic", () => {
30
- // The schematic in the spec uses these names; renaming requires a major
31
- // bump. (Some files ship under slightly different names; see the
32
- // on-disk anchor check below.)
33
- expect(section).toContain("write-source.ts");
34
- expect(section).toContain("config.ts");
35
- expect(section).toContain("errors.ts");
36
- expect(section).toContain("cli.ts");
37
- });
38
- test("locked anchor files exist on disk", () => {
39
- for (const rel of REQUIRED_FILES) {
40
- expect(fs.existsSync(path.join(repoRoot, rel))).toBe(true);
41
- }
42
- });
43
- test("locked anchor directories exist on disk", () => {
44
- for (const rel of REQUIRED_DIRS) {
45
- const stat = fs.statSync(path.join(repoRoot, rel));
46
- expect(stat.isDirectory()).toBe(true);
47
- }
48
- });
49
- test("§7 lists what was removed from 0.6.0", () => {
50
- expect(section).toMatch(/Removed from 0\.6\.0/);
51
- expect(section).toMatch(/openviking/i);
52
- expect(section).toMatch(/stash-search\.ts|stash-show\.ts/);
53
- });
54
- test("§7 stops before §8 (helper boundary check)", () => {
55
- expect(section).not.toContain("## 8.");
56
- expect(section).not.toContain("## 9.");
57
- });
58
- });
@@ -1,34 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §8 — Extension points.
4
- //
5
- // The freeze rule: six surfaces are pluggable at v1; four are deliberately
6
- // not. Removing or adding a surface to either list after v1.0 is a major
7
- // bump.
8
- const PLUGGABLE = ["SourceProvider", "RegistryProvider", "Asset type", "Embedder", "Renderer", "Ingest transformer"];
9
- const NOT_EXTENSIBLE = ["API-backed sources", "Vault", "Scorer algorithm", "Output format"];
10
- describe("v1 spec §8 — extension points", () => {
11
- const spec = readDoc(SPEC_PATH);
12
- const section = extractSection(spec, "## 8. Extension points");
13
- test("§8 exists in the spec", () => {
14
- expect(section).not.toBe("");
15
- });
16
- test("§8 names every pluggable surface at v1", () => {
17
- for (const surface of PLUGGABLE) {
18
- expect(section).toContain(surface);
19
- }
20
- });
21
- test("§8 names every surface deliberately not extensible at v1", () => {
22
- for (const surface of NOT_EXTENSIBLE) {
23
- expect(section).toContain(surface);
24
- }
25
- });
26
- test("§8 declares output format is text/json only", () => {
27
- expect(section).toMatch(/`text` and `json` only/);
28
- expect(section).toMatch(/ndjson.*tsv.*mcp/);
29
- });
30
- test("§8 stops before §9 (helper boundary check)", () => {
31
- expect(section).not.toContain("## 9.");
32
- expect(section).not.toContain("## 10.");
33
- });
34
- });
@@ -1,75 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { CLI_DOC_PATH, extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §9.4 — CLI command surface.
4
- //
5
- // The locked surface is exhaustive. The shipped pre-release set and the
6
- // planned-for-v1 additions together form the v1.0 freeze. Renaming or
7
- // removing any command after v1.0 is a major version bump.
8
- const SHIPPED_COMMANDS = [
9
- "add",
10
- "remove",
11
- "list",
12
- "update",
13
- "search",
14
- "show",
15
- "clone",
16
- "index",
17
- "setup",
18
- "remember",
19
- "import",
20
- "feedback",
21
- "info",
22
- "curate",
23
- "workflow",
24
- "vault",
25
- "wiki",
26
- "enable",
27
- "disable",
28
- "completions",
29
- "upgrade",
30
- "save",
31
- "help",
32
- "hints",
33
- "config",
34
- ];
35
- const PLANNED_FOR_V1 = ["agent", "reflect", "propose", "proposal", "distill"];
36
- describe("v1 spec §9.4 — CLI command surface", () => {
37
- const spec = readDoc(SPEC_PATH);
38
- const section = extractSection(spec, "### 9.4 CLI command surface");
39
- test("§9.4 exists in the spec", () => {
40
- expect(section).not.toBe("");
41
- });
42
- test("§9.4 lists every shipped pre-release command", () => {
43
- // The shipped set is rendered as a pipe-joined inline-code block; tokens
44
- // appear as standalone words. We assert each command word appears in
45
- // the section text without caring about its surrounding backticks.
46
- for (const cmd of SHIPPED_COMMANDS) {
47
- const re = new RegExp(`\\b${cmd}\\b`);
48
- expect(re.test(section)).toBe(true);
49
- }
50
- expect(section).toMatch(/\bregistry\b/);
51
- });
52
- test("§9.4 declares each planned-for-v1 command", () => {
53
- for (const cmd of PLANNED_FOR_V1) {
54
- // accept either `cmd` or `cmd <args>` patterns
55
- const re = new RegExp(`\`${cmd}\\b`);
56
- expect(re.test(section)).toBe(true);
57
- }
58
- });
59
- test("§9.4 explicitly says renaming or removing is major", () => {
60
- expect(section).toMatch(/major version bump/i);
61
- });
62
- });
63
- describe("v1 spec §9.4 — cli.md mirrors the surface", () => {
64
- const cli = readDoc(CLI_DOC_PATH);
65
- test("cli.md has an Available-since-0.7.0 section listing the 0.7.0 commands", () => {
66
- const planned = extractSection(cli, "## Agent reflection and proposal queue (0.7.0+)");
67
- expect(planned).not.toBe("");
68
- for (const cmd of PLANNED_FOR_V1) {
69
- expect(planned).toContain(`### ${cmd}`);
70
- }
71
- });
72
- test("cli.md uses the documented status legend", () => {
73
- expect(cli).toMatch(/Available since 0\.7\.0/);
74
- });
75
- });
@@ -1,36 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { extractSection, readDoc, SPEC_PATH } from "./spec-helpers";
3
- // Pins v1 spec §9.7 — LLM/agent boundary.
4
- //
5
- // Two locked invariants:
6
- // * In-tree LLM helpers are bounded, single-shot, stateless — no shells,
7
- // no long-running processes, no caches keyed on prior responses.
8
- // * External agents are invoked via CLI shell-out only. akm never imports
9
- // a vendor SDK.
10
- describe("v1 spec §9.7 — LLM/agent boundary", () => {
11
- const spec = readDoc(SPEC_PATH);
12
- const section = extractSection(spec, "### 9.7 LLM/agent boundary");
13
- test("§9.7 exists in the spec", () => {
14
- expect(section).not.toBe("");
15
- });
16
- test("§9.7 declares in-tree LLM is bounded, single-shot, stateless", () => {
17
- expect(section).toMatch(/bounded/i);
18
- expect(section).toMatch(/single-shot/i);
19
- expect(section).toMatch(/stateless/i);
20
- });
21
- test("§9.7 declares external agents are CLI shell-out only", () => {
22
- // Tolerate markdown line-wrapping by collapsing whitespace + emphasis
23
- // markers when matching.
24
- const flat = section.replace(/[*\s]+/g, " ");
25
- expect(flat).toMatch(/CLI shell-out only/i);
26
- expect(flat).toMatch(/never imports vendor SDKs/i);
27
- });
28
- test("§9.7 names a `llm.features.*` per-call-site gate", () => {
29
- expect(section).toMatch(/llm\.features\.\*/);
30
- expect(section).toMatch(/exactly one/i);
31
- });
32
- test("§9.7 says crossing the boundary is a contract violation", () => {
33
- const flat = section.replace(/\s+/g, " ");
34
- expect(flat).toMatch(/contract violation/i);
35
- });
36
- });