@oomkapwn/enquire-mcp 3.6.0-rc.2 → 3.6.0-rc.4
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.
- package/CHANGELOG.md +143 -0
- package/README.md +10 -4
- package/STABILITY.md +2 -1
- package/assets/social-preview.png +0 -0
- package/dist/embeddings.d.ts +10 -0
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/embeddings.js +83 -24
- package/dist/embeddings.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/prompts.d.ts +32 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +315 -0
- package/dist/prompts.js.map +1 -1
- package/dist/tools/media.d.ts +209 -0
- package/dist/tools/media.d.ts.map +1 -1
- package/dist/tools/media.js +121 -0
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/meta.d.ts +441 -0
- package/dist/tools/meta.d.ts.map +1 -1
- package/dist/tools/meta.js +341 -0
- package/dist/tools/meta.js.map +1 -1
- package/dist/tools/read.d.ts +535 -15
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +377 -6
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/search.d.ts +341 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +247 -0
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/write.d.ts +432 -20
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +376 -19
- package/dist/tools/write.js.map +1 -1
- package/docs/audits/v3.6.0-rc.4-rootcause.md +134 -0
- package/docs/audits/v3.6.0-system-audit-plan.md +199 -0
- package/docs/benchmarks.md +460 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,149 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [3.6.0-rc.4] — 2026-05-15
|
|
6
|
+
|
|
7
|
+
> **TL;DR:** v3.6.0 Phase 4 of 4 — TypeDoc + GitHub Pages auto-publish of API reference, public retrieval benchmarks (60 queries, ablation across 7 stack configs, **+24.7 MRR / +15.5 NDCG@10 reranker delta measured**), Class A invariants for hardcoded-paths, full-system audit plan committed, AND a **P0 fix to the BGE cross-encoder reranker which had been a no-op for all 5 catalog models since v2.9.0**. Published under npm dist-tag `rc`.
|
|
8
|
+
|
|
9
|
+
**Pre-release — v3.6.0 sprint Phase 4 + critical reranker fix.**
|
|
10
|
+
|
|
11
|
+
### 🚨 Fixed — P0: cross-encoder reranker was a no-op (v2.9.0..v3.6.0-rc.3)
|
|
12
|
+
|
|
13
|
+
**The bug.** `src/embeddings.ts:loadReranker()` used the high-level `text-classification` pipeline from `@huggingface/transformers`. The pipeline softmax'es over the model's classification head. BGE-style cross-encoders have a **single output class** (the relevance logit); softmax over 1 class is always 1.0 by definition. The reranker returned `score: 1.0` for every input regardless of query/passage relevance — i.e., it didn't re-order anything. The hybrid-search pipeline downstream sorted by tied 1.0s, so the reranker's contribution was effectively null.
|
|
14
|
+
|
|
15
|
+
**How it stayed hidden for 6+ months.** `tests/reranker.test.ts` (introduced in v2.9.0) tested the reranker integration by injecting a mock `rerankerOverride` with hand-authored score functions. The mock path verified that `ctx.reranker` was called, that errors surfaced via `signal_errors.reranker`, that scores re-ordered hits. But the REAL model path (`loadReranker()` → pipeline → score) was never tested end-to-end. The bench-driven rediscovery this release (rc.4 benchmarks) finally exercised the real path and surfaced the no-op.
|
|
16
|
+
|
|
17
|
+
**The fix.** `loadReranker()` now uses `AutoTokenizer.from_pretrained` + `AutoModelForSequenceClassification.from_pretrained` directly, reads the raw relevance logit from `logits.data[i]`, and applies sigmoid `1/(1+exp(-x))` to map to a `[0, 1]` relevance score that's comparable across queries. Empirically: on `Xenova/bge-reranker-base`, a RAG-relevant passage gets score ~0.93 vs an off-topic Tokyo passage at ~0.0001 — a 4-order-of-magnitude discrimination that the old code returned as exactly tied 1.0.
|
|
18
|
+
|
|
19
|
+
**Catalog impact.**
|
|
20
|
+
| Alias | HuggingFace ID | Pre-fix behavior | Post-fix behavior |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| `rerank-bge` | `Xenova/bge-reranker-base` | no-op (1.0 flat) | ✅ **verified working end-to-end** |
|
|
23
|
+
| `rerank-multilingual` | `Xenova/mxbai-rerank-xsmall-v1` | no-op (1.0 flat) | ⚠️ fails on `AutoTokenizer.from_pretrained` — transformers.js compatibility issue, NOT this fix's regression. Tracked for v3.7. |
|
|
24
|
+
| `rerank-bge-large` | `Xenova/bge-reranker-large` | no-op (1.0 flat) | ⏳ unverified — model download timed out in CI smoke (560 MB). Tracked for v3.7. |
|
|
25
|
+
| `rerank-jina-tiny` | `Xenova/jina-reranker-v1-tiny-en` | no-op (1.0 flat) | ⚠️ same `tokenizer_class` error. Tracked for v3.7. |
|
|
26
|
+
| `rerank-multilingual-large` | `Xenova/mxbai-rerank-large-v2` | no-op (1.0 flat) | ⚠️ same `tokenizer_class` error. Tracked for v3.7. |
|
|
27
|
+
|
|
28
|
+
**For v3.6.0**: the fix lands for `rerank-bge` (the project's primary documented reranker — also the one the benchmark numbers in `docs/benchmarks.md` are measured against). The 4 other catalog aliases were no-ops before this release and remain non-functional at the model-load layer due to an unrelated transformers.js compatibility issue uncovered by the fix. Users who selected those aliases got the same (broken) behavior they had before; users on `rerank-bge` now get the +24.7 MRR / +15.5 NDCG@10 boost the project always advertised.
|
|
29
|
+
|
|
30
|
+
**Regression catch.** New `tests/reranker-smoke.test.ts` (opt-in via `ENQUIRE_LOAD_RERANKER_SMOKE=1`) exercises the real model path: every catalog alias must score a RAG-relevant passage HIGHER than an off-topic passage. If the no-op class returns in any form, this test fails.
|
|
31
|
+
|
|
32
|
+
### Added — TypeDoc + GitHub Pages
|
|
33
|
+
|
|
34
|
+
- **`typedoc@0.28.19`** installed as devDependency.
|
|
35
|
+
- **`typedoc.json`** at repo root: entry points `src/index.ts`, `src/tools/index.ts`, `src/tool-manifest.ts`. `excludeInternal: true` honors the `@internal` markers from rc.3. Output: `docs/api-reference/` (gitignored — generated content; CI regenerates each release).
|
|
36
|
+
- **`npm run docs:api`** script — local invocation.
|
|
37
|
+
- **`.github/workflows/publish-docs.yml`** (57 lines) — pushes to `main` trigger build + deploy to GitHub Pages via `actions/configure-pages@v6` + `actions/upload-pages-artifact@v5` + `actions/deploy-pages@v5` (OIDC-based).
|
|
38
|
+
- **README** new `## 📖 API reference` section linking `https://oomkapwn.github.io/enquire-mcp/`.
|
|
39
|
+
- **Output**: 111 HTML pages, 1.9 MB site.
|
|
40
|
+
|
|
41
|
+
### Added — Public benchmarks
|
|
42
|
+
|
|
43
|
+
- **`docs/benchmarks.md`** (460 lines) — reproducible retrieval-quality benchmark.
|
|
44
|
+
- **`scripts/run-benchmarks.mjs`** + **`tests/fixtures/benchmark-queries.jsonl`** (60 hand-authored queries across 5 categories: exact / semantic / synonym / compound / rare).
|
|
45
|
+
- **`npm run bench:retrieval`** script — regenerates `bench/benchmarks.json` deterministically (4-decimal reproducibility verified across 4 consecutive runs).
|
|
46
|
+
|
|
47
|
+
**Headline ablation (60 queries, 48-note synthetic vault, k=10):**
|
|
48
|
+
|
|
49
|
+
| Stack | MRR | NDCG@10 | Recall@10 |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| FS-grep baseline | 0.8269 | 0.8184 | 0.8844 |
|
|
52
|
+
| BM25 only | 0.4833 | 0.4060 | 0.3833 |
|
|
53
|
+
| TF-IDF only | 0.9090 | 0.8668 | 0.9039 |
|
|
54
|
+
| Embeddings only (BGE-small-en) | 0.9274 | 0.8985 | 0.9394 |
|
|
55
|
+
| Hybrid (BM25+TF-IDF+embeddings, RRF) | 0.6581 | 0.7143 | **0.9639** |
|
|
56
|
+
| **Hybrid + BGE reranker** | **0.9052** | **0.8694** | 0.9122 |
|
|
57
|
+
| Hybrid + reranker + HyDE-sim | 0.7078 | 0.5728 | 0.5933 |
|
|
58
|
+
|
|
59
|
+
The reranker delta (**+24.7 MRR, +15.5 NDCG@10** over plain hybrid) is the measured payoff of the cross-encoder layer on the new (fixed) code path. The HyDE row is simulated with hand-authored hypothetical answers (no LLM call) so it represents a floor rather than realistic LLM-driven HyDE.
|
|
60
|
+
|
|
61
|
+
### Added — Class A invariants (post-audit drift-class fix)
|
|
62
|
+
|
|
63
|
+
The audit pass after rc.1+rc.2 identified that 4 of 7 sprint errors had a single root cause: **hardcoded paths to internal modules in code outside `package.json#exports`**. This release closes that class:
|
|
64
|
+
|
|
65
|
+
- **`tests/no-internal-imports.test.ts`** (NEW) — invariant: test files cannot value-import from `src/{cli,server,tool-registry,prompts}.ts` (registration boilerplate). Future refactor of those files can't break tests by moving content.
|
|
66
|
+
- **`vitest.config.ts`** coverage exclude pivoted from 6 exact paths to a single brace-glob: `src/{index,cli,server,tool-registry,prompts,tool-manifest}.ts` — refactor-resistant.
|
|
67
|
+
|
|
68
|
+
### Fixed — `scripts/check-changelog-coverage.mjs` regex didn't match pre-release versions
|
|
69
|
+
|
|
70
|
+
Discovered during rc.4 self-audit: the script's section-detection regex `\[\d+\.\d+\.\d+\]` required the closing bracket immediately after the third version digit. Pre-release headings like `## [3.6.0-rc.4]` have `-rc.4` between the third digit and the closing bracket, so the regex didn't match. The script silently fell through to the first STABLE-semver section (`[3.5.14]`) and validated CHANGELOG against ITS coverage claims — which never drift because they were fixed at write time. **The gate was passing for the wrong reason** during the entire rc.1..rc.3 sequence.
|
|
71
|
+
|
|
72
|
+
Fixed: regex extended to `\[\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?\]`. Now actually validates the rc.4 section's claims (lines 89.20% / statements 85.79% / functions 82.15% / branches 75.02% — those are what `npm run test:coverage` actually produces on this commit).
|
|
73
|
+
|
|
74
|
+
Class: "regex assumes stricter format than spec allows." Goes to the same memory note family as the v3.5.14 `--Z` regex error.
|
|
75
|
+
|
|
76
|
+
### Added — `docs/audits/v3.6.0-system-audit-plan.md`
|
|
77
|
+
|
|
78
|
+
A 280-line plan for the post-v3.6.0-stable **full-system audit** (9 layers: code / arch / tests / CI/CD / security / docs / ops / reproducibility / process). Includes severity grading, class-identification methodology, failure handling, sign-off criteria. Will be executed when `npm view <pkg> version` reports `3.6.0` and the GH release "v3.6.0" is marked Latest.
|
|
79
|
+
|
|
80
|
+
### Validation
|
|
81
|
+
|
|
82
|
+
714 tests (713 passing + 1 skipped, the env-gated reranker smoke) · 33 test files · branches 75.02% · lines 89.20% · statements 85.79% · functions 82.15% · lint clean · `tsc` strict clean · smoke pass · version-consistency green at `3.6.0-rc.4` (5 surfaces). _(Coverage dropped marginally vs rc.3 because the new `loadReranker` + `loadTransformersForRerank` runtime paths aren't exercised by the default test suite — only by the opt-in smoke. Stays well above all thresholds.)_
|
|
83
|
+
|
|
84
|
+
### Migration
|
|
85
|
+
|
|
86
|
+
For users actively using a non-`rerank-bge` catalog alias: your reranker has been a no-op since v2.9.0; this release doesn't change that observed behavior (still no-op due to a separate compatibility issue) but at least surfaces it explicitly. Switch to `rerank-bge` to actually benefit from cross-encoder reranking. The 4 broken aliases will be addressed in v3.7 via either a transformers.js bump or a `pipeline`-fallback-with-correct-score-extraction path.
|
|
87
|
+
|
|
88
|
+
For users on `rerank-bge` (default in many configs): the reranker now actually does what it claims. Expect retrieval results to re-order meaningfully after RRF fusion. The benchmark numbers above quantify the impact.
|
|
89
|
+
|
|
90
|
+
### Method note
|
|
91
|
+
|
|
92
|
+
The reranker bug exposes a class we haven't named before: **"tests pass against a mock but the real production code path is untested."** The fix here is the new smoke test gated by env var. As a general pattern: any production code path that goes through an external dependency (HuggingFace model, SQLite, native binding) should have at least ONE end-to-end test that exercises the real dependency, not just a mock. Mocks are useful for fast unit tests; they're not a substitute for integration verification. Added to memory note `method_real_vs_mock_coverage.md` (post-v3.6.0).
|
|
93
|
+
|
|
94
|
+
## [3.6.0-rc.3] — 2026-05-15
|
|
95
|
+
|
|
96
|
+
> **TL;DR:** v3.6.0 Phase 3 of 4 — **+2238 lines of Full TSDoc** added across 44 MCP tool functions, 19 prompt definitions, and ~50 exported helpers/types. Every exported function now ships with one-sentence summary + detailed description + `@param` / `@returns` / `@throws` / `@example`. Internal cross-domain helpers marked `@internal` so v3.6.0-rc.4's TypeDoc auto-generation keeps them out of the public surface. Pure documentation addition: 712 tests pass, zero behavior change. Published under npm dist-tag `rc`.
|
|
97
|
+
|
|
98
|
+
**Pre-release — v3.6.0 sprint Phase 3.**
|
|
99
|
+
|
|
100
|
+
### Added — Full TSDoc on the public API surface
|
|
101
|
+
|
|
102
|
+
Every exported function in `src/tools/*` and every prompt in `src/prompts.ts` now has comprehensive TSDoc. Per-file expansion:
|
|
103
|
+
|
|
104
|
+
| File | Before | After | TSDoc blocks |
|
|
105
|
+
|---|---:|---:|---:|
|
|
106
|
+
| `src/tools/search.ts` | 1224 | 1565 (+341) | 62 |
|
|
107
|
+
| `src/tools/read.ts` | 864 | 1384 (+520) | 111 |
|
|
108
|
+
| `src/tools/write.ts` | 682 | 1094 (+412) | 47 |
|
|
109
|
+
| `src/tools/media.ts` | 516 | 725 (+209) | 53 |
|
|
110
|
+
| `src/tools/meta.ts` | 984 | 1425 (+441) | 76 |
|
|
111
|
+
| `src/prompts.ts` | 790 | 1105 (+315) | 20 |
|
|
112
|
+
| **Total** | **5060** | **7298** | **369 TSDoc blocks** |
|
|
113
|
+
|
|
114
|
+
The 369 TSDoc blocks include:
|
|
115
|
+
- **44 MCP tool functions** (the public API surface) — each with summary, description distinguishing it from alternatives, `@param` per parameter with type-aware description, `@returns`, `@throws` where applicable, and ` ```ts ``` ` `@example` showing realistic usage.
|
|
116
|
+
- **19 prompt registrations** in `src/prompts.ts` — each with a `// === prompt_name ============` banner header above the registration call + a TSDoc block above the banner describing purpose, expected args (read from `argsSchema`), and intended use case.
|
|
117
|
+
- **~30 exported types/interfaces** (e.g., `SearchHit`, `SearchHybridResponse`, `RenameNoteResult`, `ContextPackResult`) — each with description and field-level docs where the field-doc convention was already in place.
|
|
118
|
+
- **~15 cross-domain helpers** (e.g., `tokenizeForTfidf`, `findBestMatch`, `resolveTarget`, `rewriteRawTarget`, `jaccard`) — marked `@internal` so the v3.6.0-rc.4 TypeDoc pass keeps them out of the public API reference.
|
|
119
|
+
|
|
120
|
+
Distinct-from cross-references are present where two functions could be confused:
|
|
121
|
+
- `searchText` / `semanticSearch` / `embeddingsSearch` / `searchHybrid` — each TSDoc explicitly contrasts the variant and points readers at `{@link searchHybrid}` as the recommended umbrella entry.
|
|
122
|
+
- `vault_synth` / `vault_synthesis_page` / `vault_research` / `search_with_query_expansion` — prompt-to-prompt cross-references explaining when each is the right pick.
|
|
123
|
+
|
|
124
|
+
### Validation
|
|
125
|
+
|
|
126
|
+
712 unit tests pass · branches 75.29% · lines 89.54% · statements 86.07% · functions 82.15% · lint clean · `tsc` strict + `noUncheckedIndexedAccess` clean · smoke pass · version-consistency green at `3.6.0-rc.3` (5 surfaces).
|
|
127
|
+
|
|
128
|
+
### Migration
|
|
129
|
+
|
|
130
|
+
**No-op for consumers.** No function signatures changed, no behavior changed, no exports added or removed. Pure documentation addition.
|
|
131
|
+
|
|
132
|
+
For contributors:
|
|
133
|
+
- IDE hovers now display full descriptions + examples for every tool function.
|
|
134
|
+
- VS Code, Cursor, IntelliJ, Vim+lsp all surface the TSDoc instantly.
|
|
135
|
+
|
|
136
|
+
### npm dist-tag
|
|
137
|
+
|
|
138
|
+
Published under **`rc`** dist-tag. Users on `latest` stay on v3.5.14. Try: `npm install @oomkapwn/enquire-mcp@rc`.
|
|
139
|
+
|
|
140
|
+
### Next RC
|
|
141
|
+
|
|
142
|
+
`v3.6.0-rc.4`: TypeDoc auto-generation of API reference docs + publish to GitHub Pages. Plus public benchmarks (MRR / NDCG@10 / Recall@K on a BEIR/TREC subset, with comparison vs main competitors).
|
|
143
|
+
|
|
144
|
+
### Method note
|
|
145
|
+
|
|
146
|
+
This is the second phase that ships **without any logic change** — pure structural/documentation work that compounds value: the TSDoc written here becomes the source for rc.4's auto-generated API docs site. The maintenance burden going forward is low because the TSDoc lives next to the code (drift requires actively writing wrong docs vs. doing nothing).
|
|
147
|
+
|
|
5
148
|
## [3.6.0-rc.2] — 2026-05-15
|
|
6
149
|
|
|
7
150
|
> **TL;DR:** v3.6.0 Phase 2 of 4 — `src/index.ts` (3665 lines) split into 5 domain modules (`cli.ts` 702 + `server.ts` 877 + `tool-registry.ts` 1300 + `prompts.ts` 790) plus a slim 84-line entry point. NEW `src/tool-manifest.ts` (318 lines, 44 machine-readable tool entries) becomes the single source of truth — `tests/docs-consistency.test.ts` pivoted off regex-parsing source code and reads the manifest directly. Pure refactor: same CLI surface, same registered tools, same 712 tests pass. Published under npm dist-tag `rc`.
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://github.com/oomkapwn/enquire-mcp/actions/workflows/ci.yml)
|
|
12
12
|
[](https://www.npmjs.com/package/@oomkapwn/enquire-mcp)
|
|
13
13
|
[](https://www.npmjs.com/package/@oomkapwn/enquire-mcp)
|
|
14
|
-
[](#trust)
|
|
15
15
|
[](./STABILITY.md)
|
|
16
16
|
[](https://slsa.dev/spec/v1.0/levels#build-l3)
|
|
17
17
|
[](https://modelcontextprotocol.io/)
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
A **production-ready MCP server** that gives any AI agent — Claude Code, Claude Desktop, Cursor, ChatGPT custom GPT, Codex, mobile MCP clients — structured access to your Obsidian vault. The umbrella `obsidian_search` tool fuses **BM25 + TF-IDF + multilingual ML embeddings** via Reciprocal Rank Fusion (Cormack et al, 2009), reranks with a **BGE cross-encoder** (5 model options), scales to millions of chunks via **HNSW with int8 quantization**, and returns blended markdown + PDF hits with `[page: N]` citations.
|
|
31
31
|
|
|
32
|
-
**44 tools · 19 MCP prompts ·
|
|
32
|
+
**44 tools · 19 MCP prompts · 714 unit tests · 50+ languages · v3.5.x · semver-bound · MIT · SLSA-3.**
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -65,6 +65,12 @@ enquire-mcp doctor --vault <path> # color-coded ✓/⚠/✗ health check
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
+
## 📖 API reference
|
|
69
|
+
|
|
70
|
+
Auto-generated **[API reference at oomkapwn.github.io/enquire-mcp](https://oomkapwn.github.io/enquire-mcp/)** — every tool, prompt, and exported helper with full TSDoc (`@param` / `@returns` / `@example`). Rebuilt from source on every push to `main` via [`publish-docs.yml`](./.github/workflows/publish-docs.yml) (TypeDoc → GitHub Pages). Drift-free by construction: the same TSDoc that AI agents and IDEs see is what's published.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
68
74
|
## 🏆 Why it's the best
|
|
69
75
|
|
|
70
76
|
**Six features no other Obsidian-MCP has at all** (GraphRAG-light, standalone `.base` execution, HyDE, int8 quantization, late-chunking, built-in eval harness). **Plus the entire modern IR stack** (BM25 + ML embeddings + cross-encoder reranking + HNSW) that competitors ship at most one or two of. Side-by-side:
|
|
@@ -89,7 +95,7 @@ enquire-mcp doctor --vault <path> # color-coded ✓/⚠/✗ health check
|
|
|
89
95
|
| **GraphRAG-light** (wikilink community detection via Louvain modularity) | ✅ **only here** | ❌ | ❌ |
|
|
90
96
|
| **Standalone `.base` query execution** (works without Obsidian running) | ✅ **only here** | ❌ | ❌ delegates to Obsidian |
|
|
91
97
|
| **HyDE retrieval** (Gao et al 2023) + sub-question decomposition | ✅ **only here** | ❌ | ❌ |
|
|
92
|
-
| **
|
|
98
|
+
| **714 unit tests · 7 required + 4 advisory CI gates per PR** | ✅ | n/a | rare |
|
|
93
99
|
| **SLSA-3 build provenance** | ✅ | n/a | ❌ |
|
|
94
100
|
| **Semver-bound public surface** ([STABILITY.md](./STABILITY.md)) | ✅ | n/a | ❌ |
|
|
95
101
|
| Standalone (no Obsidian plugin needed) | ✅ | ❌ requires Obsidian | varies |
|
|
@@ -199,7 +205,7 @@ Channel: `npm install @oomkapwn/enquire-mcp` → latest stable. Full changelog:
|
|
|
199
205
|
```bash
|
|
200
206
|
git clone https://github.com/oomkapwn/enquire-mcp.git
|
|
201
207
|
cd enquire-mcp && npm install
|
|
202
|
-
npm test # full suite (
|
|
208
|
+
npm test # full suite (714 tests, ~5s)
|
|
203
209
|
npm run lint # zero warnings
|
|
204
210
|
npm run build # tsc → dist/
|
|
205
211
|
```
|
package/STABILITY.md
CHANGED
|
@@ -50,8 +50,9 @@ The package exports a few symbols for advanced embedding / programmatic use. The
|
|
|
50
50
|
- `EmbedDb` / `EmbedDbOptions` / `EmbedQuantization` / `encodeInt8Vector` / `decodeInt8Vector` (`src/embed-db.ts`)
|
|
51
51
|
- `FtsIndex` / `chunkContent` / `defaultIndexFile` (`src/fts5.ts`)
|
|
52
52
|
- `Vault` (`src/vault.ts`)
|
|
53
|
-
- `ServeOptions` / `parsePositiveInt` / `parseQuantizationMode` / `startServer` / `main` / `buildMcpServer` / `prepareServerDeps` / `formatReadyBanner` / `buildEmbedText` (`src/index.ts`)
|
|
53
|
+
- `ServeOptions` / `parsePositiveInt` / `parseQuantizationMode` / `startServer` / `main` / `buildMcpServer` / `prepareServerDeps` / `formatReadyBanner` / `buildEmbedText` — re-exported from `src/index.ts` (since v3.6.0-rc.2 they live in `src/server.ts` / `src/cli.ts` / `src/tool-registry.ts`, with `src/index.ts` keeping the re-export surface for v3.5.x BC).
|
|
54
54
|
- `HnswIndex` / `loadHnswFromDisk` / `HnswPersistedMeta` (`src/hnsw.ts`)
|
|
55
|
+
- `TOOL_MANIFEST` / `ToolManifestEntry` (`src/tool-manifest.ts`) — machine-readable manifest of all MCP tools (added in v3.6.0-rc.2). New stable surface — guaranteed to retain `name`, `kind`, `gating`, `summary` fields per entry across all v3.x.
|
|
55
56
|
|
|
56
57
|
Anything not listed here (private fields, internal helpers, test fixtures) is **not** semver-bound.
|
|
57
58
|
|
|
Binary file
|
package/dist/embeddings.d.ts
CHANGED
|
@@ -66,6 +66,16 @@ export interface Reranker {
|
|
|
66
66
|
* `loadEmbedder`). Cold-start downloads the model from HuggingFace
|
|
67
67
|
* (~25-110 MB depending on alias) into `~/.cache/huggingface/`.
|
|
68
68
|
*
|
|
69
|
+
* **v3.6.0-rc.4 P0 fix.** Previously used the high-level
|
|
70
|
+
* `text-classification` pipeline, which softmax'es over the model's
|
|
71
|
+
* classification head. BGE-style rerankers have a SINGLE output class
|
|
72
|
+
* (relevance logit) — softmax over 1 class is always 1.0, so the
|
|
73
|
+
* pipeline returned `score: 1.0` for every input. **The reranker was
|
|
74
|
+
* effectively a no-op.** Hidden because `tests/reranker.test.ts` used a
|
|
75
|
+
* mock `rerankerOverride` that never exercised the real model. Now
|
|
76
|
+
* fixed: direct tokenizer + model inference + sigmoid maps the raw
|
|
77
|
+
* relevance logit to [0, 1].
|
|
78
|
+
*
|
|
69
79
|
* @param alias - Reranker alias from RERANKER_MODELS (default: "rerank-multilingual").
|
|
70
80
|
*/
|
|
71
81
|
export declare function loadReranker(alias?: string): Promise<Reranker>;
|
package/dist/embeddings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.d.ts","sourceRoot":"","sources":["../src/embeddings.ts"],"names":[],"mappings":"AAcA;;mCAEmC;AACnC,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,YAAY,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiBpE,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,iBAA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B,SAAS,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CASlE;AAuBD,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAqDlE,CAAC;AAEH,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAQ7E;AAED,6EAA6E;AAC7E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuDpE"}
|
package/dist/embeddings.js
CHANGED
|
@@ -44,6 +44,8 @@ export function resolveModel(alias) {
|
|
|
44
44
|
// tokenizer transitive deps surface only when the user actually invokes an
|
|
45
45
|
// embeddings codepath. Mirrors the better-sqlite3 lazy-load in src/fts5.ts.
|
|
46
46
|
let pipelineCtor = null;
|
|
47
|
+
let autoTokenizerCtor = null;
|
|
48
|
+
let autoModelForSeqClsCtor = null;
|
|
47
49
|
async function loadPipeline() {
|
|
48
50
|
if (pipelineCtor)
|
|
49
51
|
return pipelineCtor;
|
|
@@ -61,6 +63,43 @@ async function loadPipeline() {
|
|
|
61
63
|
`Original error: ${err instanceof Error ? err.message : String(err)}`);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* v3.6.0-rc.4 P0 fix — load `AutoTokenizer` + `AutoModelForSequenceClassification`
|
|
68
|
+
* directly from `@huggingface/transformers`. Reason: the high-level
|
|
69
|
+
* `text-classification` pipeline applies softmax over the model's
|
|
70
|
+
* classification head. BGE-reranker family (and the other sigmoid-head
|
|
71
|
+
* cross-encoders we ship) have a SINGLE output class — softmax over 1
|
|
72
|
+
* class is always 1.0 by definition, so the pipeline returns
|
|
73
|
+
* `{ label: "LABEL_0", score: 1 }` for every input regardless of
|
|
74
|
+
* relevance. Empirically verified on `Xenova/bge-reranker-base`.
|
|
75
|
+
*
|
|
76
|
+
* Direct inference: tokenize the (query, passage) pair, run the model,
|
|
77
|
+
* read the raw logit from `logits.data[0]`, apply sigmoid to map to
|
|
78
|
+
* [0, 1]. Yields meaningful relevance scoring.
|
|
79
|
+
*
|
|
80
|
+
* Tests/regression catch: `tests/reranker.test.ts` previously used a
|
|
81
|
+
* mock `rerankerOverride` so the bug never surfaced. v3.6.0-rc.4 adds
|
|
82
|
+
* an opt-in real-model smoke test that exercises this codepath.
|
|
83
|
+
*/
|
|
84
|
+
async function loadTransformersForRerank() {
|
|
85
|
+
if (autoTokenizerCtor && autoModelForSeqClsCtor) {
|
|
86
|
+
return { AutoTokenizer: autoTokenizerCtor, AutoModelForSequenceClassification: autoModelForSeqClsCtor };
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const mod = (await import("@huggingface/transformers"));
|
|
90
|
+
if (!mod.AutoTokenizer || !mod.AutoModelForSequenceClassification) {
|
|
91
|
+
throw new Error("@huggingface/transformers has no `AutoTokenizer` / `AutoModelForSequenceClassification` exports");
|
|
92
|
+
}
|
|
93
|
+
autoTokenizerCtor = mod.AutoTokenizer;
|
|
94
|
+
autoModelForSeqClsCtor = mod.AutoModelForSequenceClassification;
|
|
95
|
+
return { AutoTokenizer: autoTokenizerCtor, AutoModelForSequenceClassification: autoModelForSeqClsCtor };
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
throw new Error("Rerankers require the optional '@huggingface/transformers' dependency; install failed or the binding could not be loaded. " +
|
|
99
|
+
"Run: npm install @huggingface/transformers (or reinstall enquire-mcp without --omit=optional). " +
|
|
100
|
+
`Original error: ${err instanceof Error ? err.message : String(err)}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
64
103
|
/** Load an embedder for the given model alias. First call may block on
|
|
65
104
|
* model download from HuggingFace (~120MB for multilingual). Subsequent
|
|
66
105
|
* calls reuse the cached weights under `~/.cache/huggingface/`.
|
|
@@ -184,42 +223,62 @@ export function resolveRerankerModel(alias) {
|
|
|
184
223
|
* `loadEmbedder`). Cold-start downloads the model from HuggingFace
|
|
185
224
|
* (~25-110 MB depending on alias) into `~/.cache/huggingface/`.
|
|
186
225
|
*
|
|
226
|
+
* **v3.6.0-rc.4 P0 fix.** Previously used the high-level
|
|
227
|
+
* `text-classification` pipeline, which softmax'es over the model's
|
|
228
|
+
* classification head. BGE-style rerankers have a SINGLE output class
|
|
229
|
+
* (relevance logit) — softmax over 1 class is always 1.0, so the
|
|
230
|
+
* pipeline returned `score: 1.0` for every input. **The reranker was
|
|
231
|
+
* effectively a no-op.** Hidden because `tests/reranker.test.ts` used a
|
|
232
|
+
* mock `rerankerOverride` that never exercised the real model. Now
|
|
233
|
+
* fixed: direct tokenizer + model inference + sigmoid maps the raw
|
|
234
|
+
* relevance logit to [0, 1].
|
|
235
|
+
*
|
|
187
236
|
* @param alias - Reranker alias from RERANKER_MODELS (default: "rerank-multilingual").
|
|
188
237
|
*/
|
|
189
238
|
export async function loadReranker(alias) {
|
|
190
239
|
const model = resolveRerankerModel(alias);
|
|
191
|
-
const
|
|
192
|
-
|
|
240
|
+
const { AutoTokenizer, AutoModelForSequenceClassification } = await loadTransformersForRerank();
|
|
241
|
+
// q8 quantization keeps memory bounded and CPU-friendly. Models in our
|
|
242
|
+
// catalog all ship q8 ONNX weights via Xenova/.
|
|
243
|
+
const dtype = "q8";
|
|
244
|
+
const tokenizer = (await AutoTokenizer.from_pretrained(model.hfId));
|
|
245
|
+
const seqCls = (await AutoModelForSequenceClassification.from_pretrained(model.hfId, { dtype }));
|
|
246
|
+
// Sub-batch size: cross-encoder is heavier per pair than encoder-only;
|
|
247
|
+
// 4 keeps peak memory under ~280 MB on M1 with q8 + the largest model
|
|
248
|
+
// (mxbai multilingual ~280 MB).
|
|
249
|
+
const MAX_INTERNAL_BATCH = 4;
|
|
193
250
|
return {
|
|
194
251
|
model,
|
|
195
252
|
async score(query, passages) {
|
|
196
253
|
if (passages.length === 0)
|
|
197
254
|
return [];
|
|
198
|
-
// Build the (query, passage) pair inputs. transformers.js
|
|
199
|
-
// text-classification accepts an array; the model returns one
|
|
200
|
-
// {label, score} per input.
|
|
201
|
-
const inputs = passages.map((p) => ({ text: query, text_pair: p }));
|
|
202
|
-
// Sub-batch to bound memory — same rationale as the embedder's
|
|
203
|
-
// MAX_INTERNAL_BATCH. Cross-encoder is heavier per pair, so we use a
|
|
204
|
-
// smaller batch (4) to keep peak memory under ~150 MB on M1.
|
|
205
|
-
const MAX_INTERNAL_BATCH = 4;
|
|
206
255
|
const out = [];
|
|
207
|
-
for (let batchStart = 0; batchStart <
|
|
208
|
-
const batch =
|
|
209
|
-
|
|
210
|
-
//
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
256
|
+
for (let batchStart = 0; batchStart < passages.length; batchStart += MAX_INTERNAL_BATCH) {
|
|
257
|
+
const batch = passages.slice(batchStart, batchStart + MAX_INTERNAL_BATCH);
|
|
258
|
+
// Batched tokenization: each pair is (query, passage_i). transformers.js
|
|
259
|
+
// accepts parallel arrays for the second positional + the text_pair
|
|
260
|
+
// option. padding:true pads to the longest sequence in the batch;
|
|
261
|
+
// truncation:true clips to the model's max position (typically 512).
|
|
262
|
+
const queries = new Array(batch.length).fill(query);
|
|
263
|
+
const inputs = tokenizer(queries, { text_pair: [...batch], padding: true, truncation: true });
|
|
264
|
+
const { logits } = await seqCls(inputs);
|
|
265
|
+
// For a 1-class sigmoid head: logits shape [batch, 1] → flat
|
|
266
|
+
// Float32Array of length batch. Map each logit through sigmoid to
|
|
267
|
+
// get a [0, 1] relevance score that's comparable across queries.
|
|
268
|
+
for (let i = 0; i < batch.length; i++) {
|
|
269
|
+
const raw = logits.data[i];
|
|
270
|
+
if (typeof raw !== "number" || Number.isNaN(raw)) {
|
|
271
|
+
// Defensive: -Infinity puts the hit at the bottom of the sort
|
|
272
|
+
// rather than poisoning order with NaN.
|
|
221
273
|
out.push(-Infinity);
|
|
274
|
+
continue;
|
|
222
275
|
}
|
|
276
|
+
// Sigmoid: 1 / (1 + exp(-x)). Stable for extreme magnitudes
|
|
277
|
+
// because exp(-large) → 0 and exp(-very-negative) → +∞ both
|
|
278
|
+
// clamp gracefully (the latter overflows to Infinity and the
|
|
279
|
+
// division yields 0, which is the correct relevance for a
|
|
280
|
+
// strongly-negative logit).
|
|
281
|
+
out.push(1 / (1 + Math.exp(-raw)));
|
|
223
282
|
}
|
|
224
283
|
}
|
|
225
284
|
return out;
|
package/dist/embeddings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddings.js","sourceRoot":"","sources":["../src/embeddings.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,sEAAsE;AACtE,gFAAgF;AAChF,EAAE;AACF,gBAAgB;AAChB,8EAA8E;AAC9E,oEAAoE;AACpE,wEAAwE;AACxE,yEAAyE;AACzE,iFAAiF;AACjF,8EAA8E;AAC9E,uEAAuE;AAoBvE,MAAM,CAAC,MAAM,gBAAgB,GAA6C,MAAM,CAAC,MAAM,CAAC;IACtF,YAAY,EAAE;QACZ,KAAK,EAAE,cAAc;QACrB,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,6DAA6D;gBAC7D,kEAAkE;gBAClE,iEAAiE;gBACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBAC3B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;wBACjD,8DAA8D;wBAC9D,wCAAwC;wBACxC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;wBACpB,SAAS;oBACX,CAAC;oBACD,4DAA4D;oBAC5D,4DAA4D;oBAC5D,6DAA6D;oBAC7D,0DAA0D;oBAC1D,4BAA4B;oBAC5B,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* + `McpServer({version})`) and `src/tool-registry.ts` (used in the
|
|
8
8
|
* `vault-info` resource payload).
|
|
9
9
|
*/
|
|
10
|
-
export declare const VERSION = "3.6.0-rc.
|
|
10
|
+
export declare const VERSION = "3.6.0-rc.4";
|
|
11
11
|
export { main } from "./cli.js";
|
|
12
12
|
export { buildEmbedText, buildMcpServer, formatReadyBanner, prepareServerDeps, type ServeOptions, type ServerDeps, startServer } from "./server.js";
|
|
13
13
|
export { parsePositiveInt, parseQuantizationMode } from "./tool-registry.js";
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { main } from "./cli.js";
|
|
|
32
32
|
* + `McpServer({version})`) and `src/tool-registry.ts` (used in the
|
|
33
33
|
* `vault-info` resource payload).
|
|
34
34
|
*/
|
|
35
|
-
export const VERSION = "3.6.0-rc.
|
|
35
|
+
export const VERSION = "3.6.0-rc.4";
|
|
36
36
|
// Re-exports — preserve the v3.5.x public surface so http-transport.ts and
|
|
37
37
|
// tests don't need to know about the new module layout. The set below
|
|
38
38
|
// exactly matches the v3.5.x `export` declarations: `main`,
|
package/dist/prompts.d.ts
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/**
|
|
3
|
+
* Register all enquire-mcp prompt templates on the given MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Prompts are agent-side orchestration recipes — each one expands into a
|
|
6
|
+
* structured `user`-role message that tells the LLM how to chain
|
|
7
|
+
* `obsidian_*` tools to accomplish a higher-level workflow (weekly review,
|
|
8
|
+
* Karpathy-style wiki maintenance, captcha-style ingest, sub-question
|
|
9
|
+
* decomposition, etc.). No server-side LLM calls happen here; the prompts
|
|
10
|
+
* are pure prompt engineering that the calling client surfaces to its own
|
|
11
|
+
* model.
|
|
12
|
+
*
|
|
13
|
+
* Total: 19 prompts grouped roughly into:
|
|
14
|
+
* - Day-to-day vault hygiene (`summarize_recent_edits`, `weekly_review`,
|
|
15
|
+
* `monthly_review`, `extract_todos`, `process_inbox`, `consolidate_tags`,
|
|
16
|
+
* `find_orphans`, `find_duplicates`)
|
|
17
|
+
* - Wiki maintenance (`lint_wiki`, `vault_synth`, `vault_wiki_compile`,
|
|
18
|
+
* `vault_lint_extended`, `vault_synthesis_page`)
|
|
19
|
+
* - Retrieval orchestration (`search_with_query_expansion`, `vault_research`,
|
|
20
|
+
* `vault_persona_search`)
|
|
21
|
+
* - Knowledge capture / automation (`vault_capture`, `vault_automation_setup`)
|
|
22
|
+
* - Reading-list helpers (`review_tag`)
|
|
23
|
+
*
|
|
24
|
+
* Called once at server startup by `tool-registry.ts`.
|
|
25
|
+
*
|
|
26
|
+
* @param server - The MCP server to register prompts on. Mutated in place.
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const server = new McpServer({ name: "enquire-mcp", version: "3.6.0" });
|
|
30
|
+
* registerPrompts(server);
|
|
31
|
+
* registerTools(server, vault, ctx);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
2
34
|
export declare function registerPrompts(server: McpServer): void;
|
|
3
35
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6iCvD"}
|