ko-qmd 2.8.3-ko.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 (56) hide show
  1. package/CHANGELOG.md +1376 -0
  2. package/LICENSE +21 -0
  3. package/README.ko.md +86 -0
  4. package/README.md +1307 -0
  5. package/bin/qmd +192 -0
  6. package/dist/ast.d.ts +65 -0
  7. package/dist/ast.js +334 -0
  8. package/dist/bench/bench.d.ts +35 -0
  9. package/dist/bench/bench.js +327 -0
  10. package/dist/bench/score.d.ts +33 -0
  11. package/dist/bench/score.js +88 -0
  12. package/dist/bench/types.d.ts +80 -0
  13. package/dist/bench/types.js +8 -0
  14. package/dist/cli/build-info.json +4 -0
  15. package/dist/cli/embed-lock.d.ts +24 -0
  16. package/dist/cli/embed-lock.js +94 -0
  17. package/dist/cli/formatter.d.ts +120 -0
  18. package/dist/cli/formatter.js +355 -0
  19. package/dist/cli/mcp-pid.d.ts +25 -0
  20. package/dist/cli/mcp-pid.js +86 -0
  21. package/dist/cli/qmd.d.ts +43 -0
  22. package/dist/cli/qmd.js +4424 -0
  23. package/dist/cli/version.d.ts +42 -0
  24. package/dist/cli/version.js +80 -0
  25. package/dist/collections.d.ts +167 -0
  26. package/dist/collections.js +410 -0
  27. package/dist/db.d.ts +63 -0
  28. package/dist/db.js +130 -0
  29. package/dist/hangul.d.ts +54 -0
  30. package/dist/hangul.js +140 -0
  31. package/dist/index.d.ts +237 -0
  32. package/dist/index.js +244 -0
  33. package/dist/llm.d.ts +543 -0
  34. package/dist/llm.js +1747 -0
  35. package/dist/maintenance.d.ts +33 -0
  36. package/dist/maintenance.js +52 -0
  37. package/dist/mcp/origin-guard.d.ts +67 -0
  38. package/dist/mcp/origin-guard.js +137 -0
  39. package/dist/mcp/server.d.ts +116 -0
  40. package/dist/mcp/server.js +883 -0
  41. package/dist/paths.d.ts +1 -0
  42. package/dist/paths.js +4 -0
  43. package/dist/store.d.ts +1100 -0
  44. package/dist/store.js +4965 -0
  45. package/dist/trust.d.ts +152 -0
  46. package/dist/trust.js +249 -0
  47. package/package.json +114 -0
  48. package/scripts/build.mjs +72 -0
  49. package/scripts/check-package-grammars.mjs +29 -0
  50. package/scripts/package-smoke.mjs +65 -0
  51. package/scripts/test-all.mjs +38 -0
  52. package/skills/qmd/SKILL.md +316 -0
  53. package/skills/qmd/references/mcp-setup.md +119 -0
  54. package/skills/release/SKILL.md +141 -0
  55. package/skills/release/scripts/install-hooks.sh +38 -0
  56. package/skills/release/scripts/release-context.sh +129 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1376 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [2.8.3-ko.2] - 2026-09-17
6
+
7
+ ### Changes
8
+
9
+ - Published to npm as `ko-qmd`. Install with `npm i -g ko-qmd`
10
+ after `npm uninstall -g @tobilu/qmd` (both ship a `qmd` bin). `publish.yml` is
11
+ back: pushing a `v*` tag runs the tests, publishes with provenance and creates
12
+ the GitHub release. The GitHub-tag install path still works for unpublished
13
+ commits.
14
+ - New bench tooling: `scripts/bench-vault-paraphrase.ts` builds a paraphrase
15
+ goldset from a vault by asking a local model, through ollama, for the question
16
+ someone would type when they do not know the vocabulary a document is written
17
+ in. The existing `bench-vault-goldset.mjs` harvests the document's own words,
18
+ which measures lexical matching; this measures the case that fails it. Every
19
+ candidate passes four mechanical gates and a separate verification call that
20
+ rejects fluent questions about things the document does not discuss. Defaults
21
+ to `qwen3:4b`; takes `--minutes` to stop on a time budget, `--seed` to sample
22
+ the vault when it does, and `--max-df` to tune which heading words a question
23
+ may not reuse.
24
+ - `GenerateOptions` no longer has a `model` field. `LlamaCpp.generate` never read
25
+ it: the model is fixed per instance from `generateModel` at construction, so a
26
+ caller passing `model` got the instance's model back with no error and no
27
+ indication the request was dropped. Construct a second `LlamaCpp` to generate
28
+ with a different model. Nothing in the package passed the field.
29
+
30
+ ### Fixes
31
+
32
+ - The release pre-push hook reads CI from the remote being pushed to. It asked
33
+ `gh api repos/{owner}/{repo}`, which resolves through gh's own remote
34
+ heuristic: with an `upstream` remote present that is the repo this one was
35
+ forked from, so every commit that exists only here answered 422. The hook
36
+ reported "no runs found" and let the tag through unverified. An API error now
37
+ aborts instead of reading as "CI has not started".
38
+
39
+ ## [2.8.3-ko.1] - 2026-09-16
40
+
41
+ ### Changes
42
+
43
+ - ko-vault bench fixture pins the package's default embedding model
44
+ (Qwen3-Embedding-0.6B-Q8_0) instead of embeddinggemma. Measured on the same
45
+ tree: `vector_r5` 0.9861 → 1.0000, `hybrid_r5` 0.9722 → 0.9861, `bm25_r5`
46
+ unchanged at 0.6528. Numbers and caveats in
47
+ `test/fixtures/ko-vault/BASELINE.md`.
48
+ - README.md states what this distribution is and links README.ko.md.
49
+ - Hangul lex queries also strip a verbal or nominalizing ending (`토큰화하는` →
50
+ `토큰화`, `검색하기` → `검색`) and unwind a two-particle chain (`청킹에서의` →
51
+ `청킹`). ko-vault bench `bm25_r5` 0.6635 → 0.7212 on a 52-query goldset, with
52
+ the original 36 queries unchanged at 0.6528.
53
+ - Hangul stems also cover a bare `한`/`된` ending (`필요한` → `필요`) and the
54
+ 하↔해 contraction (`더하` ↔ `더해`), so a query stem meets the contracted spelling
55
+ documents actually use. `bm25_r5` 0.7212 → 0.7404, hybrid and full 1.0000.
56
+ - Long Korean queries no longer return nothing. `searchFTS` retries the same
57
+ terms ORed when the strict AND matches no document at all (three terms
58
+ minimum). A natural question is a sentence, and requiring every word of it
59
+ present matched nothing: on a 30-query Korean paraphrase goldset lex recall@5
60
+ was 0.0000 and is now 0.5667. The synthetic ko-vault fixture moves with it,
61
+ `bm25_r5` 0.7404 → 0.9519.
62
+ - Hybrid RRF weights rebalanced for Korean: vector lists count half, relaxed
63
+ (ORed) lex lists count half again and never count as a strong signal, and
64
+ expansion-derived lists move 1.0 → 0.75 so the original query's vector list
65
+ still outranks a lex expansion. Hybrid recall@5 on 240 exact-phrase queries
66
+ 0.9167 → 0.9583, on the paraphrase goldset 0.8333 → 0.8667. Sweep and caveats
67
+ in `test/fixtures/ko-vault/BASELINE.md`.
68
+ - Hangul lex queries split script-mixed terms into runs and AND them
69
+ (`SKILL.md계약의핵심` → `skill` AND `md` AND `계약의핵심`). Before this the glued
70
+ token was one phrase that matches nothing, and the hyphen/dot branches kept the
71
+ Hangul run glued too. Measured on a real 232-document Korean vault with a
72
+ 240-query goldset: `bm25_r5` 0.9042 → 0.9333, `bm25_mrr` 0.8666 → 0.8937.
73
+ - `scripts/bench-vault.sh` and `scripts/bench-vault-goldset.mjs` run the Korean
74
+ bench over any real vault, building the goldset from that vault's own headings
75
+ and body clauses. Nothing from the vault is copied into the repo.
76
+ - ko-vault goldset grew 36 → 52 with particle chains, verb endings and joined
77
+ compounds.
78
+ - `qmd bench` no longer needs `expected_in_top_k` on every fixture entry. It was
79
+ required in practice: omitting it made the result limit NaN and every backend
80
+ returned zero results with no error.
81
+
82
+ ## [2.8.3-ko.0] - 2026-09-16
83
+
84
+ ### Fixes
85
+
86
+ - pnpm consumers install this package from a git tag, where pnpm runs `prepare`
87
+ (tsc only). Two things broke that on Windows: a stale `pnpm-lock.yaml`
88
+ (`ERR_PNPM_OUTDATED_LOCKFILE`) and `pnpm.onlyBuiltDependencies`, which made
89
+ pnpm build better-sqlite3 from source in an environment with no Visual Studio.
90
+ The lockfile is regenerated and the built-dependency list is now empty — the
91
+ `dist` build needs no native module, and consumers build their own. Run
92
+ `pnpm approve-builds` when developing this repo with pnpm. npm installs were
93
+ unaffected.
94
+
95
+ ### Changes
96
+
97
+ - ko-qmd distribution: package renamed to `ko-qmd`
98
+ (`2.8.3-ko.0`), consumed from git tags instead of npm (`publish.yml`
99
+ removed). CI adds a `windows-latest` Node 22 job and an Electron 39 smoke job
100
+ that imports the SDK with dynamic `import()` and runs `searchLex`. See
101
+ `README.ko.md`.
102
+ - Hangul lex queries: an unquoted Korean word also matches its stem with one
103
+ trailing particle or `기` stripped (`검색을` → `("검 색" OR "검 색 을")`,
104
+ stem ≥2 syllables). Quoted phrases and Han/kana terms are unchanged. ko-vault
105
+ bench `bm25_r5` 0.6250 → 0.6528.
106
+ - Hangul syllable bigrams in the FTS index: each indexed field carries the
107
+ bigrams of its Hangul runs after the character tokens, and a plain Korean word
108
+ queries bigram OR character phrases of the word and its stem. Character-phrase
109
+ and quoted-phrase matching is unchanged. `FTS_CJK_NORMALIZED_VERSION` is now
110
+ `"2"`, so existing indexes rebuild FTS once on open. ko-vault bench
111
+ `bm25_r5` 0.6528 → 0.6528 (no measured gain on the fixture).
112
+ - Korean defaults: the default embedding model is now
113
+ `hf:Qwen/Qwen3-Embedding-0.6B-GGUF/Qwen3-Embedding-0.6B-Q8_0.gguf`
114
+ (1024 dimensions; upstream default is embeddinggemma-300M). Reranker and
115
+ query-expansion defaults are unchanged. Existing indexes need `qmd embed -f`;
116
+ set `models: embed:` or `QMD_EMBED_MODEL` to keep embeddinggemma. The qmd skill
117
+ gains a "Korean queries" section. Hangul handling and ko-vault bench numbers
118
+ are in `README.ko.md`.
119
+
120
+ ## [2.8.3] - 2026-08-16
121
+
122
+ ### Security
123
+
124
+ - `qmd update` no longer runs a project-local `.qmd/index.yml`'s `update:`
125
+ commands without approval (#886). That file arrives with a `git clone` and is
126
+ adopted automatically for any command run inside the tree, so cloning a
127
+ repository and running `qmd update` executed shell commands chosen by whoever
128
+ wrote it. On a terminal QMD now lists the commands and asks; with nobody to
129
+ ask it skips them and keeps indexing. Approvals are recorded per config file
130
+ and per command set in `<config dir>/trusted.json`, so editing a command — or
131
+ a `git pull` that rewrites one — asks again. New `qmd trust`,
132
+ `qmd trust list` and `qmd trust revoke` manage approvals, and
133
+ `QMD_TRUST_UPDATE_HOOKS=1` opts unattended runs back in. Commands in your own
134
+ `~/.config/qmd/*.yml`, including anything `qmd collection update-cmd` writes,
135
+ are unaffected.
136
+
137
+ - The same project-local trust gate now covers collection `path` values that
138
+ resolve outside the project and non-default `models.embed` / `models.rerank`
139
+ / `models.generate` URIs (#889). In-project paths still index unattended;
140
+ out-of-project directories are skipped until `qmd trust`, and custom model
141
+ URIs are not loaded or downloaded. `QMD_TRUST_LOCAL_CONFIG=1` opts unattended
142
+ runs back in (and `QMD_TRUST_UPDATE_HOOKS=1` still does). `qmd collection
143
+ add` records trust as it writes, the same way `update-cmd` does.
144
+
145
+ - Indexing no longer follows file symlinks or glob `../` / absolute patterns
146
+ out of the collection directory. `fast-glob` already skipped symlinked
147
+ directories, but a file symlink (or a mask like `../**/*.md`) still resolved
148
+ via `realpath` and ingested the target. `qmd://` filesystem resolution uses
149
+ the same containment check, so `qmd://collection/../../../etc/passwd` no
150
+ longer produces a path outside the collection.
151
+
152
+ - `qmd mcp --http` now validates the `Origin` and `Host` headers on every
153
+ request and answers `403` when they name anything but a loopback address
154
+ (#881). Binding to localhost is no defence against the user's own browser:
155
+ a page can re-point its hostname at `127.0.0.1` (DNS rebinding) and read
156
+ the indexed corpus through `POST /query` or `POST /mcp`. Requests with no
157
+ `Origin` (curl, MCP clients, editors) are unaffected. Extend the allowlists
158
+ with `QMD_ALLOWED_ORIGINS` / `QMD_ALLOWED_HOSTS`, or set
159
+ `QMD_ALLOWED_ORIGINS=*` behind your own authenticating proxy. A wildcard
160
+ bind (`--host 0.0.0.0`) skips the host check and warns at startup.
161
+
162
+ ### Changed
163
+
164
+ - Dependencies: `node-llama-cpp` 3.18.1 → **3.20.0** (llama.cpp b8390 → b10361, 2026-08-11). Also safe patch/minors: `picomatch` 4.0.4 → 4.0.5, `web-tree-sitter` 0.26.8 → 0.26.12, `tsx` 4.21.0 → 4.23.12, `vitest` 3.2.4 → 3.2.7. No zod/vitest major; `@modelcontextprotocol/server` stays 2.0.0 (no 2.x patch). `flake.nix` FOD hashes are not updated here.
165
+ - `generate` and query expansion now await `LlamaContextSequence.dispose()` before disposing the parent context. node-llama-cpp 3.20 made sequence dispose async; the library's context-onDispose path does not wait.
166
+
167
+ - MCP server now speaks protocol revision **2026-07-28** via the official
168
+ TypeScript SDK 2.x (`@modelcontextprotocol/server`). HTTP is sessionless
169
+ (no `Mcp-Session-Id`, no initialize handshake, no idle-session TTL / #816
170
+ reaper). Clients send version and capabilities in `_meta`; `server/discover`
171
+ is implemented; Streamable HTTP POST requires `Mcp-Method` / `Mcp-Name`
172
+ (mismatch → `-32020`); `tools/list` is deterministic and carries `ttlMs` /
173
+ `cacheScope`. 2025-era stdio clients still work (`serveStdio` dual-speak);
174
+ 2025-era HTTP `initialize` is answered per-request without minting a
175
+ session. Existing tools (`query` / `get` / `multi_get` / `status`), stdio
176
+ EOF shutdown, and named-index daemon PIDs are unchanged. No release.
177
+
178
+ - `qmd pull` (and implicit model downloads in `embed`/`query`) no longer print
179
+ node-llama-cpp's download progress bar. The bar redraws every few kilobytes
180
+ and flooded agent transcripts with thousands of tokens (#776). Pass
181
+ `qmd pull --progress` to show it on an interactive terminal.
182
+ - `--full-path` no longer degrades silently when a result cannot be resolved on
183
+ disk (#785). A fallback there means the file moved or was deleted since the
184
+ last index, so `search`, `query`, `get` and `multi-get` now print a notice to
185
+ stderr naming how many results fell back and suggesting `qmd update`; stdout
186
+ stays machine-readable.
187
+ - `search`/`query` now decide per result whether to show the docid under
188
+ `--full-path`, matching `multi-get` and `get`: a result that resolved shows
189
+ its on-disk path and no docid, one that did not keeps its `qmd://` URI *and*
190
+ its docid, so it is still addressable. Previously the docid was dropped for
191
+ every row whenever the flag was set, leaving unresolved rows with neither a
192
+ usable path nor an identifier.
193
+ - `search --format csv` always emits the `docid` column, empty for rows that
194
+ resolved to an on-disk path. Under `--full-path` the header previously
195
+ dropped the column entirely — which also disagreed with the empty-result
196
+ header, always printed with `docid`. Column positions are now stable across
197
+ runs and formats.
198
+
199
+ ### Fixed
200
+
201
+ - Concurrent first-open of a cold index no longer fails with
202
+ `table documents_fts already exists` on Bun/macOS. FTS5
203
+ `CREATE VIRTUAL TABLE IF NOT EXISTS` is not atomic across WAL
204
+ connections: two processes can both see a missing table on their
205
+ schema snapshot and the loser throws. Table create and legacy-schema
206
+ repair now use the same `BEGIN IMMEDIATE` + double-check as the FTS
207
+ sync triggers, and treat a concurrent "already exists" as success
208
+ when the table is present.
209
+
210
+ - Nix flake `qmd-node-modules` FOD hashes updated for x86_64-linux and
211
+ aarch64-darwin after the MCP SDK 2.0 bump. `nix build` / Nix GHA was
212
+ failing with a fixed-output hash mismatch.
213
+
214
+ - CJK FTS rebuild no longer skips leftover `fts5(name, body, content='documents')`
215
+ tables when `fts_cjk_normalized_version` is already stamped, and schema
216
+ repair now checks live FTS columns (`PRAGMA table_info`) as well as
217
+ `sqlite_master.sql`. The MCP HTTP test helper still seeds that legacy
218
+ table; `startMcpHttpServer` / `createStore` on it must not throw
219
+ `no such column: T.name` (#792 regression).
220
+
221
+ - `qmd collection add --glob` is no longer silently ignored. parseArgs ran
222
+ with `strict: false`, so OpenClaw's `--glob memory.md` (and any other
223
+ `--glob`) fell through, the default `**/*.md` was used, and a second
224
+ collection on the same path collided as a duplicate instead of indexing
225
+ the requested mask (#536). `--glob` is now an alias for `--mask`.
226
+
227
+ - The `bin/qmd` trampoline now execs `process.execPath` instead of
228
+ re-resolving `node` from PATH. Native addons (`better-sqlite3`) are
229
+ compiled for the Node that installed qmd; a version manager (nvm, fnm,
230
+ mise) selecting a different major in the working directory used to spawn
231
+ that other binary and fail with `NODE_MODULE_VERSION` / `ERR_DLOPEN_FAILED`
232
+ (#577 leftover; #319). `bun bin/qmd` still resolves `node` from PATH so
233
+ Node-ABI addons are not loaded into bun.
234
+
235
+ - `qmd update` / `qmd collection add` no longer swallow unreadable files
236
+ silently (#460). `readFileSync` failures (ETIMEDOUT on APFS compressed
237
+ files, EAGAIN, EACCES, …) still skip the file so the rest of the collection
238
+ indexes, but the CLI now warns with the path and error code and reports
239
+ the skip count. The SDK `update()` result includes `skipped`.
240
+
241
+ - The architecture diagram no longer draws Vec expansions into BM25 search
242
+ (#680). `lex` expansions are FTS-only; `vec` and `hyde` expansions are
243
+ vector-only. The original query still goes to both backends.
244
+
245
+ - `qmd bench` no longer runs to a wall of 0.00 when the fixture collection is
246
+ missing or empty (#716). It errors up front with the same "Collection not
247
+ found" / index hint as `qmd search -c`, and if every backend still scores
248
+ zero it warns on stderr to check `qmd ls`.
249
+
250
+ - `qmd cleanup` now reclaims the content and FTS space left behind after a
251
+ wrong-directory `qmd update`. Deactivating files (the next update in the
252
+ right directory) only tombstoned the `documents` rows; cleanup deleted those
253
+ rows and vacuumed, but never dropped the unreferenced `content` hashes and
254
+ never ran FTS5 `optimize`, so `documents_fts_data` kept the old bodies
255
+ (#550). Cleanup now deletes inactive docs, then orphaned content, then
256
+ compact FTS, then vacuum. `--dry-run` reports the content hashes too.
257
+
258
+ - Concurrent `query` calls with `rerank: true` on a cold MCP server no longer
259
+ race `ensureRerankContexts()`. Embed already serialized context creation;
260
+ rerank did not, so two overlapping first queries both saw an empty pool,
261
+ both created ranking contexts, and the inactivity timer disposed the loser
262
+ (`Object is disposed`, #682). Callers now await the in-flight create.
263
+
264
+ - Embedding-context pool size no longer assumes every GGUF costs 150 MB of
265
+ VRAM (the nomic-embed figure). Larger models such as Qwen3-Embedding-0.6B
266
+ are ~1190 MB per 2048-token context; opening 8 of those exhausted an 8 GB
267
+ card so `qmd query` failed with `Failed to create any rerank context` even
268
+ though the reranker itself was fine. The pool is now sized from the weight
269
+ file, and 1 GB is reserved for the reranker (#799). Default
270
+ embeddinggemma/nomic throughput is unchanged. `QMD_EMBED_PARALLELISM` still
271
+ overrides.
272
+
273
+ - Multi-collection `-c A -c B` (and SDK/MCP `collections: [A, B]`) no longer
274
+ searches globally then post-filters. A large unrelated collection could fill
275
+ the FTS/ANN top-k so the requested collections vanished, yielding false-empty
276
+ results even though each collection matched on its own. `searchFTS` /
277
+ `searchVec` now search each requested collection, then merge by score
278
+ (#775). Single-collection exact-scan (#791, #803) is unchanged.
279
+
280
+ - Query expansion no longer consumes caller `intent`, and a cached expansion
281
+ whose sub-queries all miss is dropped instead of replaying forever (#818).
282
+ Intent still steers reranking and snippet/chunk selection; it just no longer
283
+ enters the expansion prompt or cache key, where the model copied meta-language
284
+ ("so I can compare spend settings") into lex/vec terms that matched nothing.
285
+
286
+ - Files whose names differ only in the characters the legacy slug collapsed to
287
+ `-` (spaces, underscores) no longer evict each other from the index (#717).
288
+ The handalized-path migration now skips any row whose path is still owned by
289
+ a file in the current scan, so it only adopts genuinely stale pre-2.6 rows.
290
+ `qmd get` and `qmd ls <prefix>` also match `_` and `%` in paths literally
291
+ instead of as SQL `LIKE` wildcards, so `qmd get 2026_06_16.md` no longer
292
+ returns a sibling `2026-06-16.md`.
293
+
294
+ - CLI `multi-get` and SDK/MCP `multi_get` now share one comma-list resolver.
295
+ Collection-prefixed paths (`qmd/docs/SYNTAX.md`) work in both transports,
296
+ unanchored `LIKE '%name'` no longer silently fetches a different document
297
+ for a filename fragment (`NTAX.md` ≠ `SYNTAX.md`), and ambiguous names
298
+ across collections error with the candidate list instead of `LIMIT 1` (#759).
299
+
300
+ - The Nix flake wrapper now seeds the same pre-import env as `bin/qmd`.
301
+ Nix installs exec `bun src/cli/qmd.ts` directly, so they previously skipped
302
+ the launcher: `qmd mcp` could leak llama/ggml native logs onto JSON-RPC
303
+ stdio, and Darwin CLI exits dumped a ggml Metal residency-set stack trace
304
+ after an otherwise successful query. The wrapper now quiets those logs for
305
+ `mcp` and sets `GGML_METAL_NO_RESIDENCY=1` on Darwin unless
306
+ `QMD_METAL_KEEP_RESIDENCY=1` (#723).
307
+
308
+ - Rerank context creation no longer swallows the real failure. A VRAM OOM or
309
+ corrupt model previously produced only `Reranker unavailable — skipping
310
+ reranking` (and a dead identical retry whose comment claimed it disabled
311
+ flash attention, which ranking contexts never supported). The warning now
312
+ includes the underlying message so the two cases are distinguishable (#782).
313
+
314
+ - The Nix flake package now ships `skills/` next to `src/` in `$out/lib/qmd/`.
315
+ `findPackageRoot()` walks up from the wrapped `src/cli/qmd.ts` looking for a
316
+ sibling `skills/` directory; without it, `qmd skill show` and `qmd skills list`
317
+ always failed with "QMD skill not found" on Nix-installed binaries (#722).
318
+
319
+ - `/release` step 1 no longer points at a missing script. `skills/release/scripts/release-context.sh`
320
+ now exists: it silently installs git hooks and prints version info, working-tree
321
+ status, commits and files since the last tag, `[Unreleased]`, and the previous
322
+ changelog entry. The skill's process list also drops the duplicate step 7 and
323
+ checks dependency updates before cutting the release (#796).
324
+
325
+ - `store.searchVec()` (and SDK `searchVector()`) now embed the query with the
326
+ store's pinned embed model instead of the global `QMD_EMBED_MODEL`. A store
327
+ created with a non-default `models.embed` previously failed with
328
+ `Dimension mismatch ... Expected N ... received M` and loaded the wrong
329
+ (often much larger) model at query time. Hybrid/precomputed/session search
330
+ paths were unaffected and stay unchanged (#690).
331
+
332
+ - `qmd collection add --mask "a.md,*.txt"` now indexes the union of each
333
+ pattern. The comma-separated form was documented and commonly guessed, but
334
+ the joined string was passed to fast-glob as one literal glob, so it
335
+ matched zero files with no error. Brace form `{a.md,*.txt}` is unchanged.
336
+ The same split applies on `qmd update` for stored comma-list masks (#557).
337
+
338
+ - NixOS / immutable-root installs no longer crash `qmd embed` with EACCES
339
+ when node-llama-cpp tries to compile llama.cpp into a read-only
340
+ `node_modules`. The flake wrapper puts Nix's glibc and libstdc++ on
341
+ `LD_LIBRARY_PATH` so prebuilt binaries can `dlopen` them, and
342
+ `getLlama()` uses `build: "never"` when the llama directory is not
343
+ writable (#574).
344
+
345
+ - CJK FTS rebuild no longer raises "database is busy" when flushing insert
346
+ batches. The streaming `.iterate()` cursor stayed open across
347
+ `BEGIN` on the same connection; the scan now uses keyset-paginated
348
+ `LIMIT` batches so each SELECT finalizes before the insert transaction
349
+ starts (#797).
350
+
351
+ - Quoted FTS phrases containing dotted tokens (e.g. `"1.0.21"`) now match the
352
+ indexed document. The porter unicode61 tokenizer stores dotted strings as
353
+ adjacent parts, but phrase sanitization stripped the dots into a single
354
+ token (`1021`) that could never hit. Dotted tokens inside quotes are split
355
+ into adjacent phrase terms, matching the bare-term rewrite from #563 (#757).
356
+
357
+ - `scripts/build.mjs` no longer passes `shell: true` to `spawnSync` on Windows.
358
+ With the default Node install path (`C:\Program Files\nodejs\node.exe`),
359
+ `cmd.exe` split the unquoted `process.execPath` at the space, the `tsc`
360
+ spawn failed, and `prepare` could still report success with no `dist/` —
361
+ leaving `bin/qmd` at "not built". The helper always receives a real binary
362
+ path plus an args array, so no shell is needed. A spawn error now prints
363
+ the missing binary path instead of failing silently. (#681)
364
+
365
+ - Case-sensitive collections no longer collapse distinct document identities that
366
+ differ only by path casing. The implicit `COLLATE NOCASE` legacy migration was
367
+ unsafe for filesystems that contain both `README.md` and `readme.md`; case-only
368
+ legacy migrations must now be explicit and operator-reviewed (#801).
369
+
370
+ - `cleanupOrphanedVectors` now runs its orphan count and both DELETEs in a
371
+ single immediate transaction. An interruption between the two DELETEs
372
+ (crash, `SQLITE_BUSY`) could desync `vectors_vec` from `content_vectors`,
373
+ leaving stale metadata rows that make a later reactivation of the same
374
+ content hash look already-embedded — so `qmd embed` skips it and the
375
+ document becomes silently unsearchable by vector, with no orphan left to
376
+ clean up (#766).
377
+
378
+ - `qmd embed` no longer splits a UTF-16 surrogate pair (emoji, etc.) across a
379
+ chunk boundary. A chunk ending or starting mid-pair produced an unpaired
380
+ surrogate in the chunk text, which some remote embedding APIs reject as
381
+ invalid JSON — permanently failing that chunk on every retry, since the
382
+ boundary calculation is deterministic. This covers both the character-based
383
+ chunker and `chunkDocumentByTokens`'s recursive re-splitting for
384
+ astral-plane-dense content, which could previously drive the char budget
385
+ low enough to reproduce the same split (#777).
386
+
387
+ - `insertContext` looks up `store_collections` by name. #754 retargeted the
388
+ query from the dropped `collections` table but left `WHERE id = ?`, and
389
+ `store_collections` has `name TEXT PRIMARY KEY` with no `id` column — the
390
+ call threw `no such column: id`. Matches `deleteContext` /
391
+ `updateStoreContext` (#853).
392
+
393
+ - `qmd collection add` with no path argument now errors with usage instead of
394
+ silently indexing the current working directory (#684). Pass `.` to index
395
+ CWD, matching the documented examples.
396
+
397
+ - `qmd status` reports orphaned embedding chunks, `qmd update` hints when they
398
+ exceed 10% of vectors, and `qmd cleanup --dry-run` previews what would be
399
+ removed. Incremental update still does not auto-prune vectors (a transient
400
+ empty mount would otherwise force a full re-embed) (#768).
401
+
402
+ - `qmd --index <name> mcp --http --daemon` now scopes PID/log files per index
403
+ (`mcp-<name>.pid`) and passes the resolved database path to the child, so a
404
+ named-index daemon no longer collides with the default `mcp.pid` or opens
405
+ the default store (#772).
406
+
407
+ - Opening a store no longer throws `SQLiteError: no such column: T.name` when
408
+ `documents_fts` is still the legacy `fts5(name, body, content='documents')`
409
+ schema. `CREATE VIRTUAL TABLE IF NOT EXISTS` left that table in place, and
410
+ the CJK FTS rebuild's `DELETE FROM documents_fts` compiled against
411
+ `documents.name`, which does not exist (#792).
412
+
413
+ - Rerank cache keys now include the resolved `models.rerank` URI, so swapping
414
+ the configured reranker no longer serves the previous model's cached scores
415
+ (#764).
416
+
417
+ - `vsearch -c <collection>` no longer returns empty results for small
418
+ collections crowded out of the global ANN candidate pool. `searchVec` now
419
+ exact-scans the collection's vectors with `vec_distance_cosine` when the
420
+ set is within 20k rows (ANN + post-filter cannot see collections that never
421
+ enter global top-k, and sqlite-vec caps `k` at 4096 so a larger multiplier
422
+ alone is not enough). Larger collections still use capped ANN over-fetch
423
+ (#791, #803).
424
+
425
+ - `multi-get --format files` now emits the docid as its own CSV field
426
+ (`#docid,path,...`) instead of prepending it into the path field with a
427
+ space (`#docid path,...`), matching `search --format files` and keeping
428
+ naive comma-splitting usable (#760).
429
+
430
+ - `qmd embed` now takes an exclusive process lock (`.qmd-embed.lock` next to
431
+ the index DB) so concurrent invocations no longer race on `vectors_vec`
432
+ and fail with `UNIQUE constraint failed: vectors_vec.hash_seq`. A second
433
+ embed exits early with `Another embed process is already running. Skipping.`
434
+ Stale locks from crashed processes are recovered via PID identity checks
435
+ (#825).
436
+
437
+ - windows prepare fix #778 keeps dist build #824
438
+
439
+ - `qmd mcp` (stdio) now shuts down gracefully when stdin reaches EOF instead
440
+ of orphaning to PID 1 when the parent MCP client dies (#751): the server
441
+ closes its transport, gives in-flight request handlers a bounded window to
442
+ settle, closes the store (which disposes its llama.cpp instance), and lets
443
+ the process drain via `process.exitCode` (no forced `process.exit()`, which
444
+ has caused exit-time native crashes before).
445
+
446
+ - `qmd --version` no longer reports an unrelated repository's commit (#787).
447
+ The commit was discovered at runtime with `git -C <installDir> rev-parse`,
448
+ and `git -C` walks *up*, so any install nested inside another checkout
449
+ reported that checkout's HEAD — a global npm install under a git-managed
450
+ prefix such as Homebrew's `/opt/homebrew` claimed Homebrew's commit as
451
+ qmd's. Identical tarballs reported different "commits" depending only on
452
+ where they were installed, which is why one issue can collect three distinct
453
+ hashes for the same published build. `scripts/build.mjs` now stamps the
454
+ commit it built from into `dist/cli/build-info.json` (suffixed `-dirty` when
455
+ built from a modified tree), and the runtime prefers that. Source checkouts
456
+ still resolve their own HEAD, but only after confirming the enclosing
457
+ repository is qmd's; anything else reports no commit rather than a
458
+ misleading one. The lookup also no longer interpolates the install path into
459
+ a shell string, so a path containing a space stops silently dropping the
460
+ commit, and `--version` from a build runs no subprocess at all.
461
+
462
+ - `qmd doctor` no longer false-positives `.etag` HTTP sidecars (written by
463
+ `qmd pull` next to each download) as invalid GGUF models. The model-cache
464
+ check now only inspects real `.gguf` files, so a sidecar that happens to
465
+ sort before the blob no longer poisons the report. #812
466
+
467
+ - `qmd mcp stop` and `qmd mcp --http --daemon` now verify that a pidfile PID still belongs to a qmd process before signalling it or refusing to start. Recycled PIDs (common after reboot) are treated as stale: the pidfile is unlinked instead of SIGTERM'ing an unrelated process or blocking daemon start with a false "Already running" error (#806).
468
+
469
+ - `qmd collection add` now rejects missing paths and regular files before
470
+ creating collection configuration or index state. The error reports both the
471
+ received and resolved path so malformed shell arguments can be corrected.
472
+
473
+ - Claude Code plugin: scope the plugin `source` to `./skills` so installs
474
+ copy just the skills (~50 KB) instead of the entire repository. Previously a
475
+ canonical install materialized ~230 MB / 9,000+ items into
476
+ `~/.claude/plugins/cache/` — including a full npm dependency install
477
+ triggered by the repo-root `package.json`. Both skills (`qmd` and `release`)
478
+ still ship, unchanged. (#790)
479
+
480
+ - Claude Code plugin: releases now bump the plugin version in
481
+ `.claude-plugin/marketplace.json` in lockstep with `package.json`. The
482
+ plugin cache is keyed on this version, and it had been stuck at `0.1.0`
483
+ since February — so installed plugins never received skill updates
484
+ (users who installed in February are still being served that snapshot
485
+ today, despite the qmd skill nearly tripling in size since). Also bumps
486
+ the plugin to `2.6.3` as a one-time catch-up so existing installs pick
487
+ up the current skill on their next `claude plugin update`. (#789)
488
+
489
+ ### Changed
490
+
491
+ - `--full-path` no longer degrades silently when a result cannot be resolved on
492
+ disk (#785). A fallback there means the file moved or was deleted since the
493
+ last index, so `search`, `query`, `get` and `multi-get` now print a notice to
494
+ stderr naming how many results fell back and suggesting `qmd update`; stdout
495
+ stays machine-readable.
496
+ - `search`/`query` now decide per result whether to show the docid under
497
+ `--full-path`, matching `multi-get` and `get`: a result that resolved shows
498
+ its on-disk path and no docid, one that did not keeps its `qmd://` URI *and*
499
+ its docid, so it is still addressable. Previously the docid was dropped for
500
+ every row whenever the flag was set, leaving unresolved rows with neither a
501
+ usable path nor an identifier.
502
+ - `search --format csv` always emits the `docid` column, empty for rows that
503
+ resolved to an on-disk path. Under `--full-path` the header previously
504
+ dropped the column entirely — which also disagreed with the empty-result
505
+ header, always printed with `docid`. Column positions are now stable across
506
+ runs and formats.
507
+
508
+ ## [2.6.3] - 2026-06-24
509
+
510
+ ### Added
511
+
512
+ - `qmd embed --timeout <minutes>` overrides the embed session's max duration
513
+ (previously hardcoded to 30 minutes). Use a larger value to let a big index
514
+ finish in one run, or `--timeout 0` to remove the cap entirely. When the cap is
515
+ reached, remaining document batches are skipped as before, so re-running
516
+ `qmd embed` continues where it left off.
517
+
518
+ ### Documentation
519
+
520
+ - README: added a "Configuring `index.yml`" section documenting the full config
521
+ schema — `global_context`, `editor_uri`, the `models.embed`/`rerank`/`generate`
522
+ overrides, and per-collection `path`/`pattern`/`ignore`/`update`/
523
+ `includeByDefault`/`context` — with file-location rules (`XDG_CONFIG_HOME`,
524
+ `QMD_CONFIG_DIR`, named `{name}.yml`, project-local `.qmd/index.yml`). Every key
525
+ is verified against `src/collections.ts` and its consumers. Documents behavior
526
+ that previously existed only in code, where the absence of docs led contributors
527
+ to repeatedly re-submit already-shipped model-resolution fixes (#502, #559, #564)
528
+ and to request config that already works (#645, #678). Added
529
+ `XDG_CONFIG_HOME`/`QMD_CONFIG_DIR` to the environment-variable table and noted
530
+ the `index.yml` `models:` / `QMD_EMBED_MODEL` override path in the Model
531
+ Configuration section.
532
+ - README: expanded the per-collection `update` field into an "Automatic update
533
+ commands" subsection — the feature the maintainer publicly called under-documented
534
+ — covering execution via `bash -c` in the collection's directory, the run-then-
535
+ reindex order, the non-zero-exit abort behavior, and the `qmd collection
536
+ update-cmd` set/clear shortcut. The `ignore` key now states it is YAML-only (no
537
+ CLI command) and additive with the un-overridable built-in exclusions.
538
+ - `example-index.yml`: overhauled from three near-identical collections into a
539
+ fully-commented starter template where each collection demonstrates a distinct
540
+ feature (hierarchical context, auto-`update`, `ignore` patterns, non-markdown
541
+ globs, `includeByDefault: false`, and an all-fields example), plus commented
542
+ `editor_uri`/`models` stubs. README now links to it. Model URIs are intentionally
543
+ left as placeholders so the template can't drift from the defaults.
544
+ - README: documented collection filtering (`-c` semantics), the `collection
545
+ show`/`include`/`exclude`/`update-cmd` subcommands, the `--intent`/`--no-rerank`/
546
+ `-C`/`--full-path` search flags, the `--format <kind>` output selector (with the
547
+ legacy `--json`/`--csv`/`--md`/`--xml`/`--files` booleans noted as aliases),
548
+ `vector-search`/`deep-search` aliases, embed
549
+ memory flags (`--max-docs-per-batch`/`--max-batch-mb`), a sample `--explain`
550
+ score trace, the `qmd doctor`/`qmd init` commands, the `get` `:from:count`
551
+ suffix and `--no-line-numbers`, an MCP tool parameter reference, and a
552
+ Benchmarking section for `qmd bench`.
553
+ - docs/SYNTAX.md: removed the non-existent `q` MCP parameter example (the `query`
554
+ tool and REST endpoint accept only the `searches` array) and added a Scoping
555
+ section.
556
+ - README: removed the misleading `qmd update --pull` example. The `--pull` flag is
557
+ parsed but never consumed (`updateCollections()` ignores it); the real mechanism
558
+ for running `git pull` before re-indexing is a per-collection `update` command,
559
+ set via `qmd collection update-cmd`.
560
+
561
+ ### Fixed
562
+
563
+ - MCP server instructions now tell agents to scope with the plural `collections`
564
+ parameter (matching the schema). The previous singular `collection` hint led
565
+ agents to pass a parameter that Zod silently strips, producing unscoped results.
566
+ The `get` instruction line also now documents the full `file.md:from:count`
567
+ range suffix instead of only the single-line `file.md:100` offset.
568
+
569
+ - Filesystem paths with special characters (`#`, `&`, spaces, `[]`, `()`, etc.)
570
+ now round-trip correctly through index → search → get. Previously
571
+ `reindexCollection` called `handelize()` on relative paths before storing
572
+ them, turning `# Meeting - 234232 3432 __ 5.md` into
573
+ `Meeting-234232-3432-5.md` and making `qmd get <actual-path>`,
574
+ `qmd get --full-path`, and `qmd ls` return dead or garbled paths. Paths are
575
+ now stored verbatim. Existing indexes auto-migrate on the next `qmd update`.
576
+
577
+ - FTS5 search now correctly matches dotted version strings like `2026.4.10`. The
578
+ `porter unicode61` tokenizer splits on dots (storing `2026`, `4`, `10` as
579
+ separate tokens), but the query sanitizer was stripping dots and producing
580
+ `2026410` which never matched. Dotted terms are now split and ANDed together
581
+ so version-string searches work as expected (#563).
582
+ - HTTP REST endpoints `/query` and `/search` now return `qmd://collection/path`
583
+ URIs in the `file` field, matching the output format used by the CLI and MCP
584
+ resource URIs. Previously the raw `displayPath` (`collection/path`) was
585
+ returned without the scheme prefix (#576).
586
+ - The embed session `maxDuration` is now env-configurable via
587
+ `QMD_EMBED_MAX_DURATION_MS` (default: 30 min). This prevents large-corpus
588
+ embeddings from being aborted by the hardcoded 30-minute ceiling (#673).
589
+ - `qmd query`, `qmd update`, and other commands no longer fail with
590
+ `SQLiteError: database is locked` when multiple processes run against the
591
+ same index in parallel (e.g. an `update` racing a long `embed`, the
592
+ first-open schema migration racing a routine command, or an agent fanning
593
+ out searches). `openDatabase` now sets `PRAGMA busy_timeout = 120000` on
594
+ every connection, so a writer that loses the race queues at batch
595
+ boundaries instead of throwing immediately. WAL handles read/write
596
+ concurrency but does not serialise concurrent writers, and `bun:sqlite`
597
+ and `better-sqlite3` both default the timeout to 0, so the loser
598
+ previously failed on the first DDL statement in `initializeDatabase`.
599
+ Override the default with `QMD_SQLITE_BUSY_TIMEOUT` (milliseconds; `0`
600
+ restores fail-fast). Two more crashes on the same concurrent-open
601
+ path are fixed: `trigger documents_ai already exists` (the FTS sync
602
+ triggers were dropped and recreated as separate statements on every
603
+ open, so two processes interleaved between the `DROP` and the
604
+ `CREATE`; `busy_timeout` serialises individual statements but not the
605
+ pair) and `database is locked` while migrating a cold database to WAL
606
+ (the `journal_mode` switch needs a brief exclusive lock and does not
607
+ invoke the busy handler). FTS trigger setup is now gated behind
608
+ `PRAGMA user_version` inside one `IMMEDIATE` transaction, and the WAL
609
+ migration retries within the busy-timeout budget.
610
+
611
+ ## [2.5.3] - 2026-05-28
612
+
613
+ ### Features
614
+
615
+ - `qmd get` now accepts a `:from:count` suffix on a path or docid (e.g.
616
+ `qmd get "#abc123:120:40"` reads 40 lines starting at line 120). Explicit
617
+ `--from`/`-l` flags still override the suffix. The MCP `get` tool accepts the
618
+ same suffix.
619
+ - `qmd get` and `qmd multi-get` are now **line-numbered by default** and print
620
+ the document's `#docid` and `qmd://` path in the output header. Disable line
621
+ numbers with `--no-line-numbers`. The MCP `get`/`multi_get` tools default
622
+ `lineNumbers` to `true` to match.
623
+ - `qmd multi-get` now includes the `#docid` in every output format
624
+ (`--md`, `--json`, `--csv`, `--xml`, `--files`, and the default CLI view),
625
+ consistent with `qmd search`.
626
+ - `qmd get` and `qmd multi-get` accept `--full-path`, which replaces the
627
+ `qmd://` path + `#docid` with the document's on-disk filesystem path (handy for
628
+ piping into `Read`/`Edit`/an editor). Falls back to the canonical `qmd://` +
629
+ docid header when the file no longer exists on disk.
630
+ - `qmd search` / `qmd query` now show a clearer hit identifier: the default CLI
631
+ view (and the new `**file:**` line in `--md` output) always prints the full
632
+ `qmd://collection/path` URI so you can pipe it straight back into `qmd get`.
633
+ - `qmd search` / `qmd query` accept `--full-path` with the same semantics as
634
+ `qmd get`: the result label becomes the file's on-disk path — `./`-prefixed
635
+ relative path when the file lives in a subfolder of `$PWD`, absolute realpath
636
+ otherwise — and the per-result `#docid` is dropped because the path is the
637
+ identifier. The leading `./` is intentional so the output is unambiguously a
638
+ filesystem path. Applies to all output formats.
639
+ - `qmd get` and `qmd multi-get` now also use the `./`-prefixed convention when
640
+ `--full-path` renders a path under `$PWD`, matching `search`/`query`.
641
+ - New `--format <kind>` flag selects the output format (`cli` | `json` | `csv` |
642
+ `md` | `xml` | `files`) for `search`, `query`, and `multi-get`. The legacy
643
+ boolean aliases (`--json`/`--csv`/`--md`/`--xml`/`--files`) still work but are
644
+ no longer in `--help`; prefer `--format`.
645
+
646
+ ### Fixes
647
+
648
+ - Launcher: source-mode runner selection now prefers Node + tsx over Bun when
649
+ both `package-lock.json` and `bun.lock` are present in the package root,
650
+ mirroring the dist-mode "npm priority" rule. Fixes pnpm-global installs that
651
+ copy the entire working tree (including `.git` and `bun.lock`) into the
652
+ install dir and previously routed through Bun, causing ABI mismatches with
653
+ the Node-built `better-sqlite3` / `sqlite-vec` native modules.
654
+ - Darwin Metal: llama-using commands (`query`, `vsearch`, `embed`) no longer
655
+ dump a multi-kB GGML/Metal backtrace at process exit even when output
656
+ succeeded. The libggml-metal static `ggml_metal_device` destructor asserts
657
+ `[rsets->data count] == 0` during `__cxa_finalize_ranges`, but the
658
+ buffer-free path never calls the symmetric `ggml_metal_device_rsets_rm`
659
+ to remove released rsets from the device collection (upstream
660
+ ggml-org/llama.cpp#22593, one-line fix open as PR #22595). The assertion
661
+ only fires when `process.exit()` skips Node's `beforeExit` hook, which is
662
+ what node-llama-cpp uses to auto-dispose Metal contexts. Primary fix:
663
+ `finishSuccessfulCliCommand` now sets `process.exitCode = 0` and returns
664
+ instead of calling `process.exit(0)`, so `beforeExit` fires and the native
665
+ binding cleans up before libc's static destructor runs. Defense-in-depth:
666
+ the launcher (`bin/qmd`) and the npm test driver (`scripts/test-all.mjs`
667
+ + the `test:bun` / `test:unit` package.json scripts) also set
668
+ `GGML_METAL_NO_RESIDENCY=1` on darwin before spawning node/bun, covering
669
+ error paths and tests that still terminate via `process.exit()`. The env
670
+ var must be set before node/bun start — libggml-metal reads it via libc
671
+ `getenv` at module-load time, and Bun does not propagate `process.env`
672
+ mutations to libc `setenv` — so it lives in the launcher rather than in
673
+ test-preload. Residency sets give no measurable speedup for QMD's
674
+ short-lived CLI workflow (benchmarked on M3 Pro). Opt back in with
675
+ `QMD_METAL_KEEP_RESIDENCY=1` for long-lived qmd processes (e.g. the MCP
676
+ daemon may benefit on hot reload) or to triage the upstream fix.
677
+ `qmd doctor` reports the mitigation state. Minimal reproduction:
678
+ `scripts/repro-metal-rsets-crash.mjs`.
679
+
680
+ ### Docs
681
+
682
+ - qmd skill: emphasize reading line ranges with `get`'s built-in
683
+ `:from:count` suffix / `--from`/`-l` flags instead of piping through
684
+ `sed`/`head`/`tail`; cite the docid and line numbers now present in retrieval
685
+ output; and author structured `intent:`/`lex:`/`vec:`/`hyde:` queries yourself
686
+ rather than relying on built-in query expansion.
687
+
688
+ ## [2.5.2] - 2026-05-22
689
+
690
+ ### Fixes
691
+
692
+ - Launcher: Rewrite `bin/qmd` as a Node-based shebang polyglot to fix global npm installation execution failures on Windows (#668 / #452), while supporting seamless fallback to Bun in Node-less environments.
693
+
694
+ ## [2.5.1] - 2026-05-20
695
+
696
+ ### Changes
697
+
698
+ - Release: publish from GitHub Actions via npm Trusted Publishing/OIDC instead of a long-lived `NPM_TOKEN` secret.
699
+
700
+ ## [2.5.0] - 2026-05-19
701
+
702
+ ### Changes
703
+
704
+ - Dependencies: update core SQLite/config/chunking packages (`better-sqlite3`, `yaml`, `web-tree-sitter`, `tree-sitter-go`, and `tree-sitter-python`) while keeping incompatible `zod`, `tsx`, and `vitest` majors pinned.
705
+ - Agent skills: add `qmd skills list|get|path` to serve version-matched runtime skill instructions from the installed CLI, and make `qmd skill install` write a stable discovery stub so installed agent skills do not go stale after QMD upgrades.
706
+ - CLI: add `qmd doctor` for index/runtime diagnostics, including SQLite/sqlite-vec versions, embedding fingerprint freshness, mixed-fingerprint detection, safe legacy fingerprint adoption, and content-hash sampling.
707
+
708
+ ### Fixes
709
+
710
+ - Launcher: prefer runnable TypeScript source in git checkouts even when ignored `dist/` artifacts exist, while packaged installs continue to run `dist/`.
711
+ - GPU: keep node-llama-cpp's documented `gpu: "auto"` initialization as the primary path, then perform no-build packaged CUDA/Vulkan/Metal probes only if auto falls back to CPU.
712
+ - CLI: move GPU/CPU runtime diagnostics out of `qmd status`; use `qmd doctor` for device probing and related environment guidance.
713
+ - CLI: point unexpected command/setup failures toward `qmd doctor` so diagnostics are the default next step when QMD behaves incorrectly.
714
+ - Doctor: explicitly warn when `content_vectors` contains multiple non-empty embedding fingerprint names, with the per-fingerprint document/chunk breakdown.
715
+ - Embed: make the TTY progress line label byte-based input progress explicitly, show embedded chunks as a count, and shorten the displayed model name.
716
+ - Embed: retain per-chunk failure details, retry failed chunks after later successful embeds and again when no other chunks remain, clear recovered errors, and cap retries to avoid endless loops.
717
+ - Tests: expand the container smoke harness to cover npm-global, npx-style, and Bun-global install scenarios, always checking auto and `QMD_FORCE_CPU=1` doctor modes, with opt-in tiny `qmd embed` and GPU probe runs for supported container runtimes.
718
+ - Embedding: fingerprint vector metadata using the active embedding model and formatting/chunking parameters so stale vectors are treated as pending after search semantics change. Legacy `content_vectors` columns are migrated lazily on first vector-health/write use to preserve fast QMD startup.
719
+
720
+ - Skill: expand the packaged QMD skill with retrieval-first workflows, structured query examples, wiki/source collection guidance, and safe fallbacks when model-backed search is unavailable.
721
+ - Tests: make `bun run test` execute the local unit suite under both Node/Vitest and Bun (`test:node` + `test:bun`) so runtime-specific regressions are caught before CI.
722
+ - Model config: centralize embedding/rerank/generation model resolution so `qmd embed`, `status`, `query`, `vsearch`, `pull`, SDK vector search, and `bench` use the same active `.qmd/index.yaml` model hints and environment fallbacks.
723
+ - GPU/status: `qmd status` now uses the same embedding model identity as `qmd embed` when computing pending embeddings, so URI-backed embeddings are not incorrectly reported as pending under the legacy `embeddinggemma` alias.
724
+ - GPU status: `qmd status` now always shows GPU mode/configuration without unsafe native probing, and CPU-fallback warnings point to `QMD_STATUS_DEVICE_PROBE=1 qmd status` for an actual backend probe. The no-GPU warning is emitted once per process instead of once per LLM instance during benchmarks.
725
+ - GPU: add `QMD_FORCE_CPU=1` / `--no-gpu` to bypass CUDA/Vulkan/Metal probing entirely, and route native llama.cpp stdout noise to stderr so JSON output stays parseable during search/query commands.
726
+ - Snippet line numbers: `qmd_query` (MCP), HTTP `/query`, and `qmd query`
727
+ (CLI JSON output and snippet headers) now return absolute source-file
728
+ line numbers instead of chunk-local ones, so the `line` field can be
729
+ passed back to `qmd_get` as `fromLine` without a separate lookup.
730
+ Snippet selection remains scoped to the best matching chunk
731
+ (preserves #149).
732
+ - CLI: `qmd query --full` now emits the full document body in all output
733
+ formats (json, csv, md, xml), restoring the documented behavior of the
734
+ flag. Previously it returned only the best matching chunk (~3.6KB max
735
+ per result). Output payload for `--full` queries is now proportional
736
+ to total document size.
737
+ - macOS Metal: `qmd query --json` now flushes successful JSON output and uses a safe immediate-exit path on Darwin to avoid ggml Metal finalizer aborts; other commands still dispose LLM contexts/models before the llama runtime. #368
738
+ - Embedding: require complete chunk coverage before treating a document as
739
+ embedded, remove partial vectors when chunk/session failures leave a
740
+ document incomplete, and keep `qmd status` pending counts honest after
741
+ interrupted long embed runs. #637 #378
742
+ - Embedding: `qmd embed -c <collection>` now scopes pending-doc selection
743
+ to the requested collection instead of embedding global pending work.
744
+ Scoped `--force` clears only collection-owned vectors, preserves shared
745
+ hashes referenced by sibling collections, and drops `vectors_vec` only
746
+ when the scoped clear empties all vectors.
747
+ - Hybrid search: weight RRF lists by query type so original FTS and original vector evidence get the intended 2x boost, instead of accidentally boosting the first lexical expansion. #591
748
+ - MCP: seed llama.cpp/GGML quiet env vars before launching `qmd mcp` so native logs cannot pollute stdio JSON-RPC framing. #593
749
+ - CLI: remove CommonJS `require()` calls from ESM index path normalization so `qmd --index <path>` no longer crashes with `ERR_AMBIGUOUS_MODULE_SYNTAX` on Node 22+. #634
750
+ - Windows CUDA: serialize llama.cpp embedding/reranking contexts by default to avoid intermittent `ggml-cuda.cu:98` crashes in `qmd query`; set `QMD_EMBED_PARALLELISM` to opt back into parallel contexts if your driver is stable. #519
751
+ - MCP: make `qmd mcp --index <name>` use the selected index for both foreground and daemon HTTP servers instead of falling back to the default store. #343
752
+ - Embedding: respect `QMD_EMBED_MODEL` consistently for vector indexing and vector-backed search, with default-model fallback when unset.
753
+ - Config: use one home-directory resolver for YAML config and the default SQLite cache path, avoiding Windows CLI/MCP split-brain when `HOME` is unset.
754
+ - GPU: respect explicit `QMD_LLAMA_GPU=metal|vulkan|cuda` backend overrides instead of always using auto GPU selection. #529
755
+ - Fix: preserve original filename case in `handelize()`. The previous
756
+ `.toLowerCase()` call made indexed paths unreachable on case-sensitive
757
+ filesystems (Linux). `qmd update` automatically migrates legacy
758
+ lowercase paths without re-embedding.
759
+ - CLI: make `qmd status` skip native `node-llama-cpp` device probing by
760
+ default so status stays safe on machines with broken or unsupported GPU
761
+ drivers. Set `QMD_STATUS_DEVICE_PROBE=1` to opt in.
762
+ - CLI: lazy-load `node-llama-cpp` so lightweight commands such as
763
+ `qmd status` do not import native ML dependencies or trigger llama.cpp
764
+ builds on ARM/no-GPU machines. #491
765
+ - Store: keep content rows referenced by inactive documents during orphan
766
+ cleanup so `qmd update` preserves soft-deleted tombstones for removed
767
+ files. #585
768
+ - Packaging: install AST grammar WASM packages as required dependencies so
769
+ Bun global installs include TypeScript/TSX/JavaScript grammars, and add a
770
+ `smoke:package-grammars` verification command. #595
771
+ - Launcher: add wrapper smoke coverage for scoped package, npm/npx,
772
+ Homebrew/Linuxbrew, Bun global symlink layouts, and `$BUN_INSTALL`
773
+ false-positive runtime selection regressions. #351 #353 #354 #356 #358 #359
774
+
775
+ ## [2.1.0] - 2026-04-05
776
+
777
+ Code files now chunk at function and class boundaries via tree-sitter,
778
+ clickable editor links land you at the right line from search results,
779
+ and per-collection model configuration means you can point different
780
+ collections at different embedding models. 25+ community PRs fix
781
+ embedding stability, BM25 accuracy, and cross-platform launcher issues.
782
+
783
+ ### Changes
784
+
785
+ - AST-aware chunking for code files via `web-tree-sitter`. Supported
786
+ languages: TypeScript/JavaScript, Python, Go, and Rust. Code files
787
+ are chunked at function, class, and import boundaries instead of
788
+ arbitrary text positions. Markdown and unknown file types are unchanged.
789
+ `--chunk-strategy <auto|regex>` flag on `qmd embed` and `qmd query`
790
+ (default `regex`). SDK: `chunkStrategy` option on `embed()` and
791
+ `search()`. `qmd status` shows grammar availability.
792
+ - `qmd bench <fixture.json>` command for search quality benchmarks.
793
+ Measures precision@k, recall, MRR, and F1 across BM25, vector, hybrid,
794
+ and full pipeline backends. Ships with an example fixture against
795
+ the eval-docs test collection. #470 (thanks @jmilinovich)
796
+ - `models:` section in `index.yml` lets you configure `embed`, `rerank`,
797
+ and `generate` model URIs per collection. Resolution order is
798
+ config > env var (`QMD_EMBED_MODEL`, `QMD_RERANK_MODEL`,
799
+ `QMD_GENERATE_MODEL`) > built-in default. #502
800
+ (thanks @JohnRichardEnders)
801
+ - CLI search output now emits clickable OSC 8 terminal hyperlinks when
802
+ stdout is a TTY. Links resolve `qmd://` paths to absolute filesystem
803
+ paths and open in editors via URI templates (default:
804
+ `vscode://file/{path}:{line}:{col}`). Configure with `QMD_EDITOR_URI`
805
+ or `editor_uri` in the YAML config. #508 (thanks @danmackinlay)
806
+ - `--no-rerank` flag skips the reranking step in `qmd query` — useful
807
+ when you want fast results or don't have a GPU. Also exposed as
808
+ `rerank: false` on the MCP `query` tool. #370 (thanks @mvanhorn),
809
+ #478 (thanks @zestyboy)
810
+ - ONNX conversion script for deploying embedding models via
811
+ Transformers.js. #399 (thanks @shreyaskarnik)
812
+ - GitHub Actions workflow to build the Nix flake on Linux and macOS.
813
+
814
+ ### Fixes
815
+
816
+ - Embedding: prevent `qmd embed` from running indefinitely when the
817
+ embedding loop stalls. #458 (thanks @ccc-fff)
818
+ - Embedding: truncate oversized text before embedding to prevent GGML
819
+ crash, and bound memory usage during batch embedding. #393
820
+ (thanks @lskun), #395 (thanks @ProgramCaiCai)
821
+ - Embedding: set explicit embed context size (default 2048, configurable
822
+ via `QMD_EMBED_CONTEXT_SIZE`) instead of using the model's full
823
+ window. #500
824
+ - Embedding: error on dimension mismatch instead of silently rebuilding
825
+ the vec0 table. #501
826
+ - Embedding: handle vec0 `OR REPLACE` limitation in `insertEmbedding`.
827
+ #456 (thanks @antonio-mello-ai)
828
+ - Embedding: fix model selection when multiple models are configured.
829
+ #494
830
+ - BM25: correct field weights to include all 3 FTS columns — title,
831
+ body, and path were not weighted correctly. #462 (thanks @goldsr09)
832
+ - BM25: handle hyphenated tokens in FTS5 lex queries so terms like
833
+ "real-time" match correctly. #463 (thanks @goldsr09)
834
+ - BM25: preserve underscores in search terms instead of stripping them.
835
+ #404
836
+ - BM25: use CTE in `searchFTS` to prevent query planner regression with
837
+ collection filter.
838
+ - Reranker: increase default context size 2048→4096 and make
839
+ configurable via `QMD_RERANK_CONTEXT_SIZE`. Fix template overhead
840
+ underestimate 200→512. #453 (thanks @builderjarvis)
841
+ - GPU: catch initialization failures and fall back to CPU instead of
842
+ crashing.
843
+ - MCP: read version from `package.json` instead of hardcoding. #431
844
+ - MCP: include collection name in status output. #416
845
+ - Multi-get: support brace expansion patterns in glob matching. #424
846
+ - Launcher: prioritize `package-lock.json` to prevent Bun false
847
+ positive. #385 (thanks @rymalia)
848
+ - Launcher: remove `$BUN_INSTALL` check that caused false Bun detection.
849
+ #362 (thanks @syedair)
850
+ - Launcher: skip Git Bash path detection on WSL. #371
851
+ (thanks @oysteinkrog)
852
+ - Model cache: respect `XDG_CACHE_HOME` for model cache directory. #457
853
+ (thanks @antonio-mello-ai)
854
+ - SQLite: add macOS Homebrew SQLite support for Bun and restore
855
+ actionable errors. #377 (thanks @serhii12)
856
+ - Pin zod to exact 4.2.1 to fix `tsc` build failure. #382
857
+ (thanks @rymalia)
858
+ - Preserve dots and original case in `handelize()` — filenames like
859
+ `MEMORY.md` no longer become `memory-md`. #475 (thanks @alexei-led)
860
+ - Include `line` in `--json` search output so editor integrations can
861
+ jump directly to `file:line`. #506 (thanks @danmackinlay)
862
+ - Nix: fix paths in flake and make Bun dependency a fixed-output
863
+ derivation so sandboxed Linux builds work offline. #479
864
+ (thanks @surma-dump)
865
+ - Sync stale `bun.lock` (`better-sqlite3` 11.x → 12.x). CI and release
866
+ script now use `--frozen-lockfile` to prevent recurrence. #386
867
+ (thanks @Mic92)
868
+ - Approve native build scripts in pnpm so `better-sqlite3` and
869
+ tree-sitter modules compile correctly. Update vitest ^3.0.0 → ^3.2.4.
870
+
871
+ ## [2.0.1] - 2026-03-10
872
+
873
+ ### Changes
874
+
875
+ - `qmd skill install` copies the packaged QMD skill into
876
+ `~/.claude/commands/` for one-command setup. #355 (thanks @nibzard)
877
+
878
+ ### Fixes
879
+
880
+ - Fix Qwen3-Embedding GGUF filename case — HuggingFace filenames are
881
+ case-sensitive, the lowercase variant returned 404. #349 (thanks @byheaven)
882
+ - Resolve symlinked global launcher path so `qmd` works correctly when
883
+ installed via `npm i -g`. #352 (thanks @nibzard)
884
+
885
+ ## [2.0.0] - 2026-03-10
886
+
887
+ QMD 2.0 declares a stable library API. The SDK is now the primary interface —
888
+ the MCP server is a clean consumer of it, and the source is organized into
889
+ `src/cli/` and `src/mcp/`. Also: Node 25 support and a runtime-aware bin wrapper
890
+ for bun installs.
891
+
892
+ ### Changes
893
+
894
+ - Stable SDK API with `QMDStore` interface — search, retrieval, collection/context
895
+ management, indexing, lifecycle
896
+ - Unified `search()`: pass `query` for auto-expansion or `queries` for
897
+ pre-expanded lex/vec/hyde — replaces the old query/search/structuredSearch split
898
+ - New `getDocumentBody()`, `getDefaultCollectionNames()`, `Maintenance` class
899
+ - MCP server rewritten as a clean SDK consumer — zero internal store access
900
+ - CLI and MCP organized into `src/cli/` and `src/mcp/` subdirectories
901
+ - Runtime-aware `bin/qmd` wrapper detects bun vs node to avoid ABI mismatches.
902
+ Closes #319
903
+ - `better-sqlite3` bumped to ^12.4.5 for Node 25 support. Closes #257
904
+ - Utility exports: `extractSnippet`, `addLineNumbers`, `DEFAULT_MULTI_GET_MAX_BYTES`
905
+
906
+ ### Fixes
907
+
908
+ - Remove unused `import { resolve }` in store.ts that shadowed local export
909
+
910
+ ## [1.1.6] - 2026-03-09
911
+
912
+ QMD can now be used as a library. `import { createStore } from '@tobilu/qmd'`
913
+ gives you the full search and indexing API — hybrid query, BM25, structured
914
+ search, collection/context management — without shelling out to the CLI.
915
+
916
+ ### Changes
917
+
918
+ - **SDK / library mode**: `createStore({ dbPath, config })` returns a
919
+ `QMDStore` with `query()`, `search()`, `structuredSearch()`, `get()`,
920
+ `multiGet()`, and collection/context management methods. Supports inline
921
+ config (no files needed) or a YAML config path.
922
+ - **Package exports**: `package.json` now declares `main`, `types`, and
923
+ `exports` so bundlers and TypeScript resolve `@tobilu/qmd` correctly.
924
+
925
+ ## [1.1.5] - 2026-03-07
926
+
927
+ Ambiguous queries like "performance" now produce dramatically better results
928
+ when the caller knows what they mean. The new `intent` parameter steers all
929
+ five pipeline stages — expansion, strong-signal bypass, chunk selection,
930
+ reranking, and snippet extraction — without searching on its own. Design and
931
+ original implementation by Ilya Grigorik (@vyalamar) in #180.
932
+
933
+ ### Changes
934
+
935
+ - **Intent parameter**: optional `intent` string disambiguates queries across
936
+ the entire search pipeline. Available via CLI (`--intent` flag or `intent:`
937
+ line in query documents), MCP (`intent` field on the query tool), and
938
+ programmatic API. Adapted from PR #180 (thanks @vyalamar).
939
+ - **Query expansion**: when intent is provided, the expansion LLM prompt
940
+ includes `Query intent: {intent}`, matching the finetune training data
941
+ format for better-aligned expansions.
942
+ - **Reranking**: intent is prepended to the rerank query so Qwen3-Reranker
943
+ scores with domain context.
944
+ - **Chunk selection**: intent terms scored at 0.5× weight alongside query
945
+ terms (1.0×) when selecting the best chunk per document for reranking.
946
+ - **Snippet extraction**: intent terms scored at 0.3× weight to nudge
947
+ snippets toward intent-relevant lines without overriding query anchoring.
948
+ - **Strong-signal bypass disabled with intent**: when intent is provided, the
949
+ BM25 strong-signal shortcut is skipped — the obvious keyword match may not
950
+ be what the caller wants.
951
+ - **MCP instructions**: callers are now guided to provide `intent` on every
952
+ search call for disambiguation.
953
+ - **Query document syntax**: `intent:` recognized as a line type. At most one
954
+ per document, cannot appear alone. Grammar updated in `docs/SYNTAX.md`.
955
+
956
+ ## [1.1.2] - 2026-03-07
957
+
958
+ 13 community PRs merged. GPU initialization replaced with node-llama-cpp's
959
+ built-in `autoAttempt` — deleting ~220 lines of manual fallback code and
960
+ fixing GPU issues reported across 10+ PRs in one shot. Reranking is faster
961
+ through chunk deduplication and a parallelism cap that prevents VRAM
962
+ exhaustion.
963
+
964
+ ### Changes
965
+
966
+ - **GPU init**: use node-llama-cpp's `build: "autoAttempt"` instead of manual
967
+ GPU backend detection. Automatically tries Metal/CUDA/Vulkan and falls back
968
+ gracefully. #310 (thanks @giladgd — the node-llama-cpp author)
969
+ - **Query `--explain`**: `qmd query --explain` exposes retrieval score traces
970
+ — backend scores, per-list RRF contributions, top-rank bonus, reranker
971
+ score, and final blended score. Works in JSON and CLI output. #242
972
+ (thanks @vyalamar)
973
+ - **Collection ignore patterns**: `ignore: ["Sessions/**", "*.tmp"]` in
974
+ collection config to exclude files from indexing. #304 (thanks @sebkouba)
975
+ - **Multilingual embeddings**: `QMD_EMBED_MODEL` env var lets you swap in
976
+ models like Qwen3-Embedding for non-English collections. #273 (thanks
977
+ @daocoding)
978
+ - **Configurable expansion context**: `QMD_EXPAND_CONTEXT_SIZE` env var
979
+ (default 2048) — previously used the model's full 40960-token window,
980
+ wasting VRAM. #313 (thanks @0xble)
981
+ - **`candidateLimit` exposed**: `-C` / `--candidate-limit` flag and MCP
982
+ parameter to tune how many candidates reach the reranker. #255 (thanks
983
+ @pandysp)
984
+ - **MCP multi-session**: HTTP transport now supports multiple concurrent
985
+ client sessions, each with its own server instance. #286 (thanks @joelev)
986
+
987
+ ### Fixes
988
+
989
+ - **Reranking performance**: cap parallel rerank contexts at 4 to prevent
990
+ VRAM exhaustion on high-core machines. Deduplicate identical chunk texts
991
+ before reranking — same content from different files now shares a single
992
+ reranker call. Cache scores by content hash instead of file path.
993
+ - Deactivate stale docs when all files are removed from a collection and
994
+ `qmd update` is run. #312 (thanks @0xble)
995
+ - Handle emoji-only filenames (`🐘.md` → `1f418.md`) instead of crashing.
996
+ #308 (thanks @debugerman)
997
+ - Skip unreadable files during indexing (e.g. iCloud-evicted files returning
998
+ EAGAIN) instead of crashing. #253 (thanks @jimmynail)
999
+ - Suppress progress bar escape sequences when stderr is not a TTY. #230
1000
+ (thanks @dgilperez)
1001
+ - Emit format-appropriate empty output (`[]` for JSON, CSV header for CSV,
1002
+ etc.) instead of plain text "No results." #228 (thanks @amsminn)
1003
+ - Correct Windows sqlite-vec package name (`sqlite-vec-windows-x64`) and add
1004
+ `sqlite-vec-linux-arm64`. #225 (thanks @ilepn)
1005
+ - Fix claude plugin setup CLI commands in README. #311 (thanks @gi11es)
1006
+
1007
+ ## [1.1.1] - 2026-03-06
1008
+
1009
+ ### Fixes
1010
+
1011
+ - Reranker: truncate documents exceeding the 2048-token context window
1012
+ instead of silently producing garbage scores. Long chunks (e.g. from
1013
+ PDF ingestion) now get a fair ranking.
1014
+ - Nix: add python3 and cctools to build dependencies. #214 (thanks
1015
+ @pcasaretto)
1016
+
1017
+ ## [1.1.0] - 2026-02-20
1018
+
1019
+ QMD now speaks in **query documents** — structured multi-line queries where every line is typed (`lex:`, `vec:`, `hyde:`), combining keyword precision with semantic recall. A single plain query still works exactly as before (it's treated as an implicit `expand:` and auto-expanded by the LLM). Lex now supports quoted phrases and negation (`"C++ performance" -sports -athlete`), making intent-aware disambiguation practical. The formal query grammar is documented in `docs/SYNTAX.md`.
1020
+
1021
+ The npm package now uses the standard `#!/usr/bin/env node` bin convention, replacing the custom bash wrapper. This fixes native module ABI mismatches when installed via bun and works on any platform with node >= 22 on PATH.
1022
+
1023
+ ### Changes
1024
+
1025
+ - **Query document format**: multi-line queries with typed sub-queries (`lex:`, `vec:`, `hyde:`). Plain queries remain the default (`expand:` implicit, but not written inside the document). First sub-query gets 2× fusion weight — put your strongest signal first. Formal grammar in `docs/SYNTAX.md`.
1026
+ - **Lex syntax**: full BM25 operator support. `"exact phrase"` for verbatim matching; `-term` and `-"phrase"` for exclusions. Essential for disambiguation when a term is overloaded across domains (e.g. `performance -sports -athlete`).
1027
+ - **`expand:` shortcut**: send a single plain query (or start the document with `expand:` on its only line) to auto-expand via the local LLM. Query documents themselves are limited to `lex`, `vec`, and `hyde` lines.
1028
+ - **MCP `query` tool** (renamed from `structured_search`): rewrote the tool description to fully teach AI agents the query document format, lex syntax, and combination strategy. Includes worked examples with intent-aware lex.
1029
+ - **HTTP `/query` endpoint** (renamed from `/search`; `/search` kept as silent alias).
1030
+ - **`collections` array filter**: filter by multiple collections in a single query (`collections: ["notes", "brain"]`). Removed the single `collection` string param — array only.
1031
+ - **Collection `include`/`exclude`**: `includeByDefault: false` hides a collection from all queries unless explicitly named via `collections`. CLI: `qmd collection exclude <name>` / `qmd collection include <name>`.
1032
+ - **Collection `update-cmd`**: attach a shell command that runs before every `qmd update` (e.g. `git stash && git pull --rebase --ff-only && git stash pop`). CLI: `qmd collection update-cmd <name> '<cmd>'`.
1033
+ - **`qmd status` tips**: shows actionable tips when collections lack context descriptions or update commands.
1034
+ - **`qmd collection` subcommands**: `show`, `update-cmd`, `include`, `exclude`. Bare `qmd collection` now prints help.
1035
+ - **Packaging**: replaced custom bash wrapper with standard `#!/usr/bin/env node` shebang on `dist/qmd.js`. Fixes native module ABI mismatches when installed via bun, and works on any platform where node >= 22 is on PATH.
1036
+ - **Removed MCP tools** `search`, `vector_search`, `deep_search` — all superseded by `query`.
1037
+ - **Removed** `qmd context check` command.
1038
+ - **CLI timing**: each LLM step (expand, embed, rerank) prints elapsed time inline (`Expanding query... (4.2s)`).
1039
+
1040
+ ### Fixes
1041
+
1042
+ - `qmd collection list` shows `[excluded]` tag for collections with `includeByDefault: false`.
1043
+ - Default searches now respect `includeByDefault` — excluded collections are skipped unless explicitly named.
1044
+ - Fix main module detection when installed globally via npm/bun (symlink resolution).
1045
+
1046
+ ## [1.0.7] - 2026-02-18
1047
+
1048
+ ### Changes
1049
+
1050
+ - LLM: add LiquidAI LFM2-1.2B as an alternative base model for query
1051
+ expansion fine-tuning. LFM2's hybrid architecture (convolutions + attention)
1052
+ is 2x faster at decode/prefill vs standard transformers — good fit for
1053
+ on-device inference.
1054
+ - CLI: support multiple `-c` flags to search across several collections at
1055
+ once (e.g. `qmd search -c notes -c journals "query"`). #191 (thanks
1056
+ @openclaw)
1057
+
1058
+ ### Fixes
1059
+
1060
+ - Return empty JSON array `[]` instead of no output when `--json` search
1061
+ finds no results.
1062
+ - Resolve relative paths passed to `--index` so they don't produce malformed
1063
+ config entries.
1064
+ - Respect `XDG_CONFIG_HOME` for collection config path instead of always
1065
+ using `~/.config`. #190 (thanks @openclaw)
1066
+ - CLI: empty-collection hint now shows the correct `collection add` command.
1067
+ #200 (thanks @vincentkoc)
1068
+
1069
+ ## [1.0.6] - 2026-02-16
1070
+
1071
+ ### Changes
1072
+
1073
+ - CLI: `qmd status` now shows models with full HuggingFace links instead of
1074
+ static names in `--help`. Model info is derived from the actual configured
1075
+ URIs so it stays accurate if models change.
1076
+ - Release tooling: pre-push hook handles non-interactive shells (CI, editors)
1077
+ gracefully — warnings auto-proceed instead of hanging on a tty prompt.
1078
+ Annotated tags now resolve correctly for CI checks.
1079
+
1080
+ ## [1.0.5] - 2026-02-16
1081
+
1082
+ The npm package now ships compiled JavaScript instead of raw TypeScript,
1083
+ removing the `tsx` runtime dependency. A new `/release` skill automates the
1084
+ full release workflow with changelog validation and git hook enforcement.
1085
+
1086
+ ### Changes
1087
+
1088
+ - Build: compile TypeScript to `dist/` via `tsc` so the npm package no longer
1089
+ requires `tsx` at runtime. The `qmd` shell wrapper now runs `dist/qmd.js`
1090
+ directly.
1091
+ - Release tooling: new `/release` skill that manages the full release
1092
+ lifecycle — validates changelog, installs git hooks, previews release notes,
1093
+ and cuts the release. Auto-populates `[Unreleased]` from git history when
1094
+ empty.
1095
+ - Release tooling: `scripts/extract-changelog.sh` extracts cumulative notes
1096
+ for the full minor series (e.g. 1.0.0 through 1.0.5) for GitHub releases.
1097
+ Includes `[Unreleased]` content in previews.
1098
+ - Release tooling: `scripts/release.sh` renames `[Unreleased]` to a versioned
1099
+ heading and inserts a fresh empty `[Unreleased]` section automatically.
1100
+ - Release tooling: pre-push git hook blocks `v*` tag pushes unless
1101
+ `package.json` version matches the tag, a changelog entry exists, and CI
1102
+ passed on GitHub.
1103
+ - Publish workflow: GitHub Actions now builds TypeScript, creates a GitHub
1104
+ release with cumulative notes extracted from the changelog, and publishes
1105
+ to npm with provenance.
1106
+
1107
+ ## [1.0.0] - 2026-02-15
1108
+
1109
+ QMD now runs on both Node.js and Bun, with up to 2.7x faster reranking
1110
+ through parallel GPU contexts. GPU auto-detection replaces the unreliable
1111
+ `gpu: "auto"` with explicit CUDA/Metal/Vulkan probing.
1112
+
1113
+ ### Changes
1114
+
1115
+ - Runtime: support Node.js (>=22) alongside Bun via a cross-runtime SQLite
1116
+ abstraction layer (`src/db.ts`). `bun:sqlite` on Bun, `better-sqlite3` on
1117
+ Node. The `qmd` wrapper auto-detects a suitable Node.js install via PATH,
1118
+ then falls back to mise, asdf, nvm, and Homebrew locations.
1119
+ - Performance: parallel embedding & reranking via multiple LlamaContext
1120
+ instances — up to 2.7x faster on multi-core machines.
1121
+ - Performance: flash attention for ~20% less VRAM per reranking context,
1122
+ enabling more parallel contexts on GPU.
1123
+ - Performance: right-sized reranker context (40960 → 2048 tokens, 17x less
1124
+ memory) since chunks are capped at ~900 tokens.
1125
+ - Performance: adaptive parallelism — context count computed from available
1126
+ VRAM (GPU) or CPU math cores rather than hardcoded.
1127
+ - GPU: probe for CUDA, Metal, Vulkan explicitly at startup instead of
1128
+ relying on node-llama-cpp's `gpu: "auto"`. `qmd status` shows device info.
1129
+ - Tests: reorganized into flat `test/` directory with vitest for Node.js and
1130
+ bun test for Bun. New `eval-bm25` and `store.helpers.unit` suites.
1131
+
1132
+ ### Fixes
1133
+
1134
+ - Prevent VRAM waste from duplicate context creation during concurrent
1135
+ `embedBatch` calls — initialization lock now covers the full path.
1136
+ - Collection-aware FTS filtering so scoped keyword search actually restricts
1137
+ results to the requested collection.
1138
+
1139
+ ## [0.9.0] - 2026-02-15
1140
+
1141
+ First published release on npm as `@tobilu/qmd`. MCP HTTP transport with
1142
+ daemon mode cuts warm query latency from ~16s to ~10s by keeping models
1143
+ loaded between requests.
1144
+
1145
+ ### Changes
1146
+
1147
+ - MCP: HTTP transport with daemon lifecycle — `qmd mcp --http --daemon`
1148
+ starts a background server, `qmd mcp stop` shuts it down. Models stay warm
1149
+ in VRAM between queries. #149 (thanks @igrigorik)
1150
+ - Search: type-routed query expansion preserves lex/vec/hyde type info and
1151
+ routes to the appropriate backend. Eliminates ~4 wasted backend calls per
1152
+ query (10.0 → 6.0 calls, 1278ms → 549ms). #149 (thanks @igrigorik)
1153
+ - Search: unified pipeline — extracted `hybridQuery()` and
1154
+ `vectorSearchQuery()` to `store.ts` so CLI and MCP share identical logic.
1155
+ Fixes a class of bugs where results differed between the two. #149 (thanks
1156
+ @igrigorik)
1157
+ - MCP: dynamic instructions generated at startup from actual index state —
1158
+ LLMs see collection names, doc counts, and content descriptions. #149
1159
+ (thanks @igrigorik)
1160
+ - MCP: tool renames (vsearch → vector_search, query → deep_search) with
1161
+ rewritten descriptions for better tool selection. #149 (thanks @igrigorik)
1162
+ - Integration: Claude Code plugin with inline status checks and MCP
1163
+ integration. #99 (thanks @galligan)
1164
+
1165
+ ### Fixes
1166
+
1167
+ - BM25 score normalization — formula was inverted (`1/(1+|x|)` instead of
1168
+ `|x|/(1+|x|)`), so strong matches scored *lowest*. Broke `--min-score`
1169
+ filtering and made the "strong signal" short-circuit dead code. #76 (thanks
1170
+ @dgilperez)
1171
+ - Normalize Unicode paths to NFC for macOS compatibility. #82 (thanks
1172
+ @c-stoeckl)
1173
+ - Handle dense content (code) that tokenizes beyond expected chunk size.
1174
+ - Proper cleanup of Metal GPU resources on process exit.
1175
+ - SQLite-vec readiness verification after extension load.
1176
+ - Reactivate deactivated documents on re-index instead of creating duplicates.
1177
+ - Bun UTF-8 path corruption workaround for non-ASCII filenames.
1178
+ - Disable following symlinks in glob.scan to avoid infinite loops.
1179
+
1180
+ ## [0.8.0] - 2026-01-28
1181
+
1182
+ Fine-tuned query expansion model trained with GRPO replaces the stock Qwen3
1183
+ 0.6B. The training pipeline scores expansions on named entity preservation,
1184
+ format compliance, and diversity — producing noticeably better lexical
1185
+ variations and HyDE documents.
1186
+
1187
+ ### Changes
1188
+
1189
+ - LLM: deploy GRPO-trained (Group Relative Policy Optimization) query
1190
+ expansion model, hosted on HuggingFace and auto-downloaded on first use.
1191
+ Better preservation of proper nouns and technical terms in expansions.
1192
+ - LLM: `/only:lex` mode for single-type expansions — useful when you know
1193
+ which search backend will help.
1194
+ - LLM: HyDE output moved to first position so vector search can start
1195
+ embedding while other expansions generate.
1196
+ - LLM: session lifecycle management via `withLLMSession()` pattern — ensures
1197
+ cleanup even on failure, similar to database transactions.
1198
+ - Integration: org-mode title extraction support. #50 (thanks @sh54)
1199
+ - Integration: SQLite extension loading in Nix devshell. #48 (thanks @sh54)
1200
+ - Integration: AI agent discovery via skills.sh. #64 (thanks @Algiras)
1201
+
1202
+ ### Fixes
1203
+
1204
+ - Use sequential embedding on CPU-only systems — parallel contexts caused a
1205
+ race condition where contexts competed for CPU cores, making things slower.
1206
+ #54 (thanks @freeman-jiang)
1207
+ - Fix `collectionName` column in vector search SQL (was still using old
1208
+ `collectionId` from before YAML migration). #61 (thanks @jdvmi00)
1209
+ - Fix Qwen3 sampling params to prevent repetition loops — stock
1210
+ temperature/top-p caused occasional infinite repeat patterns.
1211
+ - Add `--index` option to CLI argument parser (was documented but not wired
1212
+ up). #84 (thanks @Tritlo)
1213
+ - Fix DisposedError during slow batch embedding. #41 (thanks @wuhup)
1214
+
1215
+ ## [0.7.0] - 2026-01-09
1216
+
1217
+ First community contributions. The project gained external contributors,
1218
+ surfacing bugs that only appear in diverse environments — Homebrew sqlite-vec
1219
+ paths, case-sensitive model filenames, and sqlite-vec JOIN incompatibilities.
1220
+
1221
+ ### Changes
1222
+
1223
+ - Indexing: native `realpathSync()` replaces `readlink -f` subprocess spawn
1224
+ per file. On a 5000-file collection this eliminates 5000 shell spawns,
1225
+ ~15% faster. #8 (thanks @burke)
1226
+ - Indexing: single-pass tokenization — chunking algorithm tokenized each
1227
+ document twice (count then split); now tokenizes once and reuses. #9
1228
+ (thanks @burke)
1229
+
1230
+ ### Fixes
1231
+
1232
+ - Fix `vsearch` and `query` hanging — sqlite-vec's virtual table doesn't
1233
+ support the JOIN pattern used; rewrote to subquery. #23 (thanks @mbrendan)
1234
+ - Fix MCP server exiting immediately after startup — process had no active
1235
+ handles keeping the event loop alive. #29 (thanks @mostlydev)
1236
+ - Fix collection filter SQL to properly restrict vector search results.
1237
+ - Support non-ASCII filenames in collection filter.
1238
+ - Skip empty files during indexing instead of crashing on zero-length content.
1239
+ - Fix case sensitivity in Qwen3 model filename resolution. #15 (thanks
1240
+ @gavrix)
1241
+ - Fix sqlite-vec loading on macOS with Homebrew (`BREW_PREFIX` detection).
1242
+ #42 (thanks @komsit37)
1243
+ - Fix Nix flake to use correct `src/qmd.ts` path. #7 (thanks @burke)
1244
+ - Fix docid lookup with quotes support in get command. #36 (thanks
1245
+ @JoshuaLelon)
1246
+ - Fix query expansion model size in documentation. #38 (thanks @odysseus0)
1247
+
1248
+ ## [0.6.0] - 2025-12-28
1249
+
1250
+ Replaced Ollama HTTP API with node-llama-cpp for all LLM operations. Ollama
1251
+ adds convenience but also a running server dependency. node-llama-cpp loads
1252
+ GGUF models directly in-process — zero external dependencies. Models
1253
+ auto-download from HuggingFace on first use.
1254
+
1255
+ ### Changes
1256
+
1257
+ - LLM: structured query expansion via JSON schema grammar constraints.
1258
+ Model produces typed expansions — **lexical** (BM25 keywords), **vector**
1259
+ (semantic rephrasings), **HyDE** (hypothetical document excerpts) — so each
1260
+ routes to the right backend instead of sending everything everywhere.
1261
+ - LLM: lazy model loading with 2-minute inactivity auto-unload. Keeps memory
1262
+ low when idle while avoiding ~3s model load on every query.
1263
+ - Search: conditional query expansion — when BM25 returns strong results, the
1264
+ expensive LLM expansion is skipped entirely.
1265
+ - Search: multi-chunk reranking — documents with multiple relevant chunks
1266
+ scored by aggregating across all chunks rather than best single chunk.
1267
+ - Search: cosine distance for vector search (was L2).
1268
+ - Search: embeddinggemma nomic-style prompt formatting.
1269
+ - Testing: evaluation harness with synthetic test documents and Hit@K metrics
1270
+ for BM25, vector, and hybrid RRF.
1271
+
1272
+ ## [0.5.0] - 2025-12-13
1273
+
1274
+ Collections and contexts moved from SQLite tables to YAML at
1275
+ `~/.config/qmd/index.yml`. SQLite was overkill for config — you can't share
1276
+ it, and it's opaque. YAML is human-readable and version-controllable. The
1277
+ migration was extensive (35+ commits) because every part of the system that
1278
+ touched collections or contexts had to be updated.
1279
+
1280
+ ### Changes
1281
+
1282
+ - Config: YAML-based collections and contexts replace SQLite tables.
1283
+ `collections` and `path_contexts` tables dropped from schema. Collections
1284
+ support an optional `update:` command (e.g., `git pull`) before re-index.
1285
+ - CLI: `qmd collection add/list/remove/rename` commands with `--name` and
1286
+ `--mask` glob pattern support.
1287
+ - CLI: `qmd ls` virtual file tree — list collections, files in a collection,
1288
+ or files under a path prefix.
1289
+ - CLI: `qmd context add/list/check/rm` with hierarchical context inheritance.
1290
+ A query to `qmd://notes/2024/jan/` inherits context from `notes/`,
1291
+ `notes/2024/`, and `notes/2024/jan/`.
1292
+ - CLI: `qmd context add / "text"` for global context across all collections.
1293
+ - CLI: `qmd context check` audit command to find paths without context.
1294
+ - Paths: `qmd://` virtual URI scheme for portable document references.
1295
+ `qmd://notes/ideas.md` works regardless of where the collection lives on
1296
+ disk. Works in `get`, `multi-get`, `ls`, and context commands.
1297
+ - CLI: document IDs (docid) — first 6 chars of content hash for stable
1298
+ references. Shown as `#abc123` in search results, usable with `get` and
1299
+ `multi-get`.
1300
+ - CLI: `--line-numbers` flag for get command output.
1301
+
1302
+ ## [0.4.0] - 2025-12-10
1303
+
1304
+ MCP server for AI agent integration. Without it, agents had to shell out to
1305
+ `qmd search` and parse CLI output. The monolithic `qmd.ts` (1840 lines) was
1306
+ split into focused modules with the project's first test suite (215 tests).
1307
+
1308
+ ### Changes
1309
+
1310
+ - MCP: stdio server with tools for search, vector search, hybrid query,
1311
+ document retrieval, and status. Runs over stdio transport for Claude
1312
+ Desktop and MCP clients.
1313
+ - MCP: spec-compliant with June 2025 MCP specification — removed non-spec
1314
+ `mimeType`, added `isError: true` to errors, `structuredContent` for
1315
+ machine-readable results, proper URI encoding.
1316
+ - MCP: simplified tool naming (`qmd_search` → `search`) since MCP already
1317
+ namespaces by server.
1318
+ - Architecture: extract `store.ts` (1221 LOC), `llm.ts` (539 LOC),
1319
+ `formatter.ts` (359 LOC), `mcp.ts` (503 LOC) from monolithic `qmd.ts`.
1320
+ - Testing: 215 tests (store: 96, llm: 60, mcp: 59) with mocked Ollama for
1321
+ fast, deterministic runs. Before this: zero tests.
1322
+
1323
+ ## [0.3.0] - 2025-12-08
1324
+
1325
+ Document chunking for vector search. A 5000-word document about many topics
1326
+ gets a single embedding that averages everything together, matching poorly for
1327
+ specific queries. Chunking produces one embedding per ~900-token section with
1328
+ focused semantic signal.
1329
+
1330
+ ### Changes
1331
+
1332
+ - Search: markdown-aware chunking — prefers heading boundaries, then paragraph
1333
+ breaks, then sentence boundaries. 15% overlap between chunks ensures
1334
+ cross-boundary queries still match.
1335
+ - Search: multi-chunk scoring bonus (+0.02 per additional chunk, capped at
1336
+ +0.1 for 5+ chunks). Documents relevant in multiple sections rank higher.
1337
+ - CLI: display paths show collection-relative paths and extracted titles
1338
+ (from H1 headings or YAML frontmatter) instead of raw filesystem paths.
1339
+ - CLI: `--all` flag returns all matches (use with `--min-score` to filter).
1340
+ - CLI: byte-based progress bar with ETA for `embed` command.
1341
+ - CLI: human-readable time formatting ("15m 4s" instead of "904.2s").
1342
+ - CLI: documents >64KB truncated with warning during embedding.
1343
+
1344
+ ## [0.2.0] - 2025-12-08
1345
+
1346
+ ### Changes
1347
+
1348
+ - CLI: `--json`, `--csv`, `--files`, `--md`, `--xml` output format flags.
1349
+ `--json` for programmatic access, `--files` for piping, `--md`/`--xml` for
1350
+ LLM consumption, `--csv` for spreadsheets.
1351
+ - CLI: `qmd status` shows index health — document count, size, embedding
1352
+ coverage, time since last update.
1353
+ - Search: weighted RRF — original query gets 2x weight relative to expanded
1354
+ queries since the user's actual words are a more reliable signal.
1355
+
1356
+ ## [0.1.0] - 2025-12-07
1357
+
1358
+ Initial implementation. Built in a single day for searching personal markdown
1359
+ notes, journals, and meeting transcripts.
1360
+
1361
+ ### Changes
1362
+
1363
+ - Search: SQLite FTS5 with BM25 ranking. Chose SQLite over Elasticsearch
1364
+ because QMD is a personal tool — single binary, no server dependencies.
1365
+ - Search: sqlite-vec for vector similarity. Same rationale: in-process, no
1366
+ external vector database.
1367
+ - Search: Reciprocal Rank Fusion to combine BM25 and vector results. RRF is
1368
+ parameter-free and handles missing signals gracefully.
1369
+ - LLM: Ollama for embeddings, reranking, and query expansion. Later replaced
1370
+ with node-llama-cpp in 0.6.0.
1371
+ - CLI: `qmd add`, `qmd embed`, `qmd search`, `qmd vsearch`, `qmd query`,
1372
+ `qmd get`. ~1800 lines of TypeScript in a single `qmd.ts` file.
1373
+
1374
+ [Unreleased]: https://github.com/tobi/qmd/compare/v1.0.0...HEAD
1375
+ [1.0.0]: https://github.com/tobi/qmd/releases/tag/v1.0.0
1376
+ [0.9.0]: https://github.com/tobi/qmd/compare/v0.8.0...v0.9.0