open-memex 0.11.0-alpha.2 → 0.11.0

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/AGENTS.md CHANGED
@@ -230,9 +230,9 @@ through the normal flow, not write them.
230
230
 
231
231
  ## Design constraints — read the frozen design first
232
232
 
233
- `docs/V2-DESIGN.md` is the frozen protocol v0.2 (decisions settled through D94 — log in `docs/design/decisions.md`; open questions tracked at the end of the doc). Per its §12:
233
+ `docs/V2-DESIGN.md` is the frozen protocol v0.2 (decisions settled through D96 — log in `docs/design/decisions.md`; open questions tracked at the end of the doc). Per its §12:
234
234
  AGENTS.md answers "how should AI work here"; the design doc answers "why is it
235
- built this way" (principles, iron rules, the append-only decision log in `docs/design/decisions.md`, currently D1–D94). Before changing
235
+ built this way" (principles, iron rules, the append-only decision log in `docs/design/decisions.md`, currently D1–D96). Before changing
236
236
  architecture, scope semantics, lifecycle, or the protocol surface (frontmatter
237
237
  schema, MCP tools, CLI contract), read the relevant design section — the decision
238
238
  log records what was already considered and rejected.
package/CHANGELOG.md CHANGED
@@ -7,12 +7,10 @@ rationale behind each decision lives in the decision log in
7
7
  [docs/V2-DESIGN.md](docs/V2-DESIGN.md). Pre-release builds published under
8
8
  the `@alpha` tag are development snapshots and are not listed individually.
9
9
 
10
- ## [0.11.0-alpha.2] - 2026-11-20
10
+ ## [0.11.0] - 2026-11-20
11
11
 
12
12
  - D96 embedding gate + opt-in cross-lingual rerank (EN↔ZH only, §18 item 4). **The gate first:** `scripts/bench-semantic.ts` was re-run on current code (now with `--dtype`, `--arms`, `--cache-dir`, a tax block and an explicit cross-script slice) with no retrieval change; its BM25 arm reproduces the published baseline exactly (60 memories / 47 queries, feedback off: R@1 0.660 / R@5 0.979 / MRR 0.804). Adding a local multilingual model does **not** beat BM25 as a retriever (vec-only 76.6 / 91.5 / 0.832; naive RRF 78.7 / 97.9 / 0.864), and it does not move the pooled 22,419-session ceiling — but on the six EN↔ZH queries a **BM25-first rerank** lifts R@1 from 0% to 33.3% and MRR from 0.431 to 0.597 while leaving the 41 same-language queries byte-identical. Verdict: **PASS as an opt-in rerank, FAIL as a default or a retriever**, so it ships off by default as `crossLingualRerank` (flat key, `config set`) with `embeddingModel` for the model id. When on, BM25 still chooses the hits; the local model may only reorder cross-script hits inside a contiguous run, inside one review tier, above a cosine floor — the BM25 score is never modified and a hit with too little signal keeps its exact slot. The model (q8 MiniLM, **112.8 MB**, 0.76 s warm load, 497 MB RSS, **3.1 ms per query**) downloads into the data root on first opt-in use; `@huggingface/transformers` is deliberately **not** a dependency — `npm install -g open-memex @huggingface/transformers` enables it, and without it search degrades to BM25 with a warning instead of failing. Text vectors cache in SQLite (`embedding_vectors`, 1.5 KB/vector, never dropped by a rebuild), and a same-language search never loads a model at all. `search --explain` shows whether the rerank ran, the eligible hits and every promotion with its cosine; `open-memex doctor` reports the flag, the package resolution and the cached vector count. No new MCP tool (stays 13), no new CLI verb, no general fusion and no write-path embeddings — an RRF/general-hybrid decision needs its own gate.
13
13
 
14
- ## [0.11.0-alpha.1] - 2026-11-20
15
-
16
14
  - D78 pre-submit curation, second slice (D95): submit now has a real **batch-confirm** tier next to the deterministic one. Semantic merges (near-duplicates whose similarity is >= 0.9 and whose lengths are within 60% - 0.8-0.9 stays report-only, because one flipped word lands there), **splits** of an overlong memory whose paragraphs share < 25% vocabulary (accepting keeps BOTH halves: the original keeps the first, a new memory with `derived_from` takes the second and rides the same submit), and uncertain **type/tag inferences** all appear as ONE summary screen. With proposals and no decision flag, submit stops **before writing anything** and prints the summary; `--accept-batch` applies the whole batch, `--decline-batch` changes none of it (never per-item approval). The auto tier gained high-confidence type/tag inference (e.g. an explicit `TODO:`, `We decided`, `#hashtag`) that applies **only** to keyword captures, where the hook never chose a type or tag - a tool/CLI save may have chosen it deliberately, so it goes to the batch screen instead, and an explicit non-default type is never touched. Tags are additive only, capped at 3 per memory. Every action stays reversible: `open-memex curate undo <id>` reverses the latest one, and the new `open-memex curate undo --batch <id>` reverses a whole accepted batch by replaying its exact receipts (a split undo rejoins the halves and retracts the derived part). Accepted/declined/undone counts are recorded per signal in a local `curation_feedback` table (created with `CREATE TABLE IF NOT EXISTS` next to the D77 counters, never dropped by a rebuild) and printed by `open-memex curate stats` - data for future threshold learning only, no threshold changes yet. The generated `gh pr create` body now carries the batch decision too. Fixture (`scripts/curate-eval.ts`) pins the new cases before and after: no-flag run leaves the outbox byte-identical, accepted batch = 5 auto actions + 4 batch items + 1 split part, declined batch changes nothing, and one command reverses the batch. MCP `memory_submit` gains `curateBatch="accept"|"decline"` and returns the summary as a normal result, so an agent asks once for the whole batch.
17
15
 
18
16
  ## [0.10.0] - 2026-11-13
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 9ff5f51adb3f937049b5a1f5a82be637ddd893b1b74c9b81af5e396d09a4694b
1
+ 6c7376515aaea200659929294bca99bfcb645a1591f2af662661a6a4383d8cb2
@@ -111,7 +111,7 @@ export async function applyCrossLingualRerank(query, hits, cfg) {
111
111
  const queryCjk = hasCjk(query);
112
112
  const ids = hits.map((h) => h.id);
113
113
  const rows = db()
114
- .prepare(`SELECT id, content, COALESCE(aliases, '') AS aliases, COALESCE(tags, '') AS tags
114
+ .prepare(`SELECT id, content, COALESCE(aliases, '') AS aliases, COALESCE(tags, '') AS tags
115
115
  FROM memories WHERE id IN (${ids.map(() => "?").join(",")})`)
116
116
  .all(...ids);
117
117
  const byId = new Map(rows.map((r) => [r.id, r]));
@@ -42,7 +42,7 @@ export function loadVectors(model, hashes) {
42
42
  for (let i = 0; i < hashes.length; i += CHUNK) {
43
43
  const chunk = hashes.slice(i, i + CHUNK);
44
44
  const rows = d
45
- .prepare(`SELECT hash, vector FROM embedding_vectors
45
+ .prepare(`SELECT hash, vector FROM embedding_vectors
46
46
  WHERE model = ? AND hash IN (${chunk.map(() => "?").join(",")})`)
47
47
  .all(model, ...chunk);
48
48
  for (const r of rows) {
@@ -55,7 +55,7 @@ export function loadVectors(model, hashes) {
55
55
  /** Insert or replace one vector. Idempotent on `(model, hash)`. */
56
56
  export function saveVector(model, hash, values) {
57
57
  db()
58
- .prepare(`INSERT INTO embedding_vectors (model, hash, dim, vector) VALUES (?, ?, ?, ?)
58
+ .prepare(`INSERT INTO embedding_vectors (model, hash, dim, vector) VALUES (?, ?, ?, ?)
59
59
  ON CONFLICT(model, hash) DO UPDATE SET dim = excluded.dim, vector = excluded.vector`)
60
60
  .run(model, hash, values.length, encode(values));
61
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-memex",
3
- "version": "0.11.0-alpha.2",
3
+ "version": "0.11.0",
4
4
  "mcpName": "io.github.stoneskin/open-memex",
5
5
  "description": "Local-first memory layer and protocol for AI coding agents. Markdown source of truth, SQLite FTS5 index, zero cloud.",
6
6
  "keywords": [