memorix 1.0.3 → 1.0.5

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 CHANGED
@@ -1,459 +1,521 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [1.0.3] 2026-03-14
6
-
7
- ### Added
8
- - **Memory Formation Pipeline** Three-stage pipeline (Extract Resolve Evaluate) runs in shadow mode on every `memorix_store` call and hooks trigger. Collects quality metrics without affecting storage decisions.
9
- - **Extract**: Automatic fact extraction from narratives, title normalization, entity resolution against Knowledge Graph, observation type verification.
10
- - **Resolve**: 4 resolution actions (new/merge/evolve/discard) based on similarity scoring, word overlap, and contradiction detection.
11
- - **Evaluate**: Multi-factor knowledge value assessment (type weight, fact density, specificity, causal reasoning, noise detection). Categorizes memories as core/contextual/ephemeral.
12
- - **`memorix_formation_metrics` tool** — New MCP tool to query aggregated Formation Pipeline metrics (value scores, resolution actions, extraction rates, processing times).
13
- - **`getEntityNames()` method** on `KnowledgeGraphManager` for Formation Pipeline entity resolution.
14
-
15
- ### Stats
16
- - **Default MCP Tools:** 23 (+1: `memorix_formation_metrics`)
17
- - **Tests:** 803/803 passing across 60 files (+50 new Formation Pipeline tests)
18
- - **Hooks safety:** handler.ts +21 lines (shadow call only), zero modification to existing hook logic
19
-
20
- ---
21
-
22
- ## [1.0.2] 2026-03-14
23
-
24
- ### Fixed
25
- - **MCP Server version mismatch** Server now reports the correct version from `package.json` (was hardcoded `0.1.0`). Injected at build time via tsup `define`.
26
- - **CI Node.js matrix** Removed Node 18 from CI matrix to match `engines: >=20` in `package.json`.
27
- - **Orama reindex idempotency** — `reindexObservations()` now resets the Orama DB before rebuilding, eliminating "document already exists" errors in multi-session scenarios.
28
- - **E2E tests no longer touch real user data** — Mini-skills E2E tests now use a temporary directory with synthetic observations instead of reading/writing `~/.memorix/data/`.
29
-
30
- ---
31
-
32
- ## [1.0.1] 2026-03-14
33
-
34
- ### Fixed
35
- - **OpenCode stdout pollution** — Removed all `console.log` / `console.error` from the generated OpenCode plugin template. Hooks now run fully silent. (fixes #15)
36
- - **OpenCode session_id missing** — `normalizeOpenCode()` now reads `session_id` from the payload instead of hardcoding empty string. Plugin template generates and injects a stable session ID per plugin lifetime. (fixes #14)
37
- - **Auto-install hooks scope** Hooks are now only auto-installed for IDEs whose project-level config directory already exists (e.g., `.cursor/`, `.windsurf/`), preventing unwanted IDE directories from appearing in projects opened with a different IDE.
38
-
39
- ### Added
40
- - **`MEMORIX_DATA_DIR` environment variable** — Override the default data directory (`~/.memorix/data/`) by setting `MEMORIX_DATA_DIR`. Applied consistently across persistence, alias registry, and embedding cache.
41
-
42
- ---
43
-
44
- ## [1.0.0]2026-03-09
45
-
46
- ### 🎉 First Stable Release
47
-
48
- Memorix reaches v1.0.0all major features complete. Future versions will iterate based on AI/agent ecosystem evolution.
49
-
50
- ### Added
51
- - **Multi-Agent Team Collaboration** — 4 team tools (`team_manage`, `team_file_lock`, `team_task`, `team_message`) for cross-IDE agent coordination. File-based persistence via `team-state.json`. Verified: Windsurf ↔ Antigravity bidirectional communication.
52
- - **Auto-Cleanup on Startup** — Background retention archiving and intelligent deduplication run automatically in `deferredInit`. With LLM configured: semantic dedup via any OpenAI-compatible model. Without LLM: Jaccard similarity consolidation. Zero manual maintenance required.
53
- - **`memorix_transfer` tool** — Merged `memorix_export` + `memorix_import` into a single tool with `action: "export" | "import"`.
54
- - **TEAM.md** — Multi-agent coordination protocol documentation.
55
-
56
- ### Changed
57
- - **Tool consolidation: 41 22 default tools (-46%)**
58
- - Team tools: 13 individual 4 merged (action parameter pattern)
59
- - Knowledge Graph tools: 9 conditional via `~/.memorix/settings.json` (`{ "knowledgeGraph": true }`)
60
- - Export+Import: 2 → 1 (`memorix_transfer`)
61
- - **Dashboard Team Panel** — Redesigned with Iconify icons, Material Design 3 style. Agent cards, task lists, message panel, file lock panel.
62
- - **README updated** for v1.0.0 stable (EN + 中文).
63
-
64
- ### Fixed
65
- - **Windows EPERM file lock race condition** — Treat EPERM same as EEXIST in file-lock.ts.
66
- - **PowerShell BOM in config.json** — `Set-Content -Encoding UTF8` adds BOM in PS 5.x, breaking `JSON.parse`. Always use Node.js for config file writes.
67
-
68
- ### Production Hardening
69
- - Cross-session shared team state
70
- - Inbox capped at 200 messages with auto-eviction
71
- - Session timeout GC (30min idle auto-close)
72
- - Send to inactive agent rejected
73
- - Agent leave releases file locks + clears inbox
74
- - Orphaned task rescue when assignee inactive
75
- - Input validation: agent name max 100, message max 10KB
76
-
77
- ### Stats
78
- - **Default MCP Tools:** 22 (+9 optional KG)
79
- - **Tests:** 753/753 passing across 56 files
80
- - **IDE Support:** 10 agents (Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, Antigravity, OpenCode, Trae, Gemini CLI)
81
-
82
- ## [0.12.0] — 2026-03-08
83
-
84
- ### Added
85
- - **Intent-Aware Recall** — Search understands query intent ("why X?" prioritizes decisions/trade-offs, "how to X?" prioritizes how-it-works).
86
- - **MCP Deadlock Fix** — Resolved stdio transport deadlock under high concurrency.
87
- - **Dashboard Dark Theme Fix** — Proper dark mode support across all panels.
88
- - **Build Race Condition Fix** — Fixed tsup parallel build race condition.
89
-
90
- ## [0.11.0]2026-03-07
91
-
92
- ### Added
93
- - **Mini-Skills** (`memorix_promote`) — Promote observations to permanent skills that auto-inject at session start. Never decay, project-scoped.
94
- - **LLM Quality Engine** Compact-on-write (duplicate detection at write time), narrative compression (~27% token reduction), search reranking (60% queries improved).
95
- - **`memorix_deduplicate` tool** — LLM-powered semantic deduplication with dry-run support.
96
- - **`memorix_resolve` tool** — Mark completed tasks and fixed bugs as resolved to prevent context pollution.
97
-
98
- ### Fixed
99
- - **Retention decay fix** — Reclassified `what-changed`/`discovery` to low retention (30d instead of 90d).
100
-
101
- ### Stats
102
- - **Tests:** 641 674 passing
103
-
104
- ## [0.10.6] — 2026-03-06
105
-
106
- ### Fixed
107
- - Minor stability improvements.
108
-
109
- ## [0.10.5] — 2026-03-05
110
-
111
- ### Fixed
112
- - **🔴 Critical: Antigravity MCP connection failure** — CLI banner (starting with 🧠 emoji, UTF-8 `F0 9F A7 A0`) was written to `stdout` via `console.log` in the non-interactive branch. When `citty` dispatches to `serve` subcommand, it calls parent `run()` first, polluting the MCP JSON-RPC stream. Go's `encoding/json` in Antigravity failed on the first byte `0xF0` with `invalid character 'ð'`. Fix: `console.log` → `console.error` for all CLI banner output.
113
- - **🔴 Critical: Claude Code Stop hook schema validation failure** — `hookSpecificOutput` was returned for all hook events, but Claude Code only supports it for `PreToolUse`, `UserPromptSubmit`, and `PostToolUse`. Events like `SessionStart`, `Stop`, and `PreCompact` with `hookSpecificOutput` triggered `JSON validation failed: Invalid input`. Fix: only include `hookSpecificOutput` for the 3 supported event types.
114
- - **Claude Code hook_event_name not read** — Handler read `payload.hookEventName` (camelCase) but Claude Code sends `hook_event_name` (snake_case), causing `hookEventName` to always be empty and `hookSpecificOutput` to be `{}`.
115
- - **Windows hook stdin piping broken** — `cmd /c memorix hook` wrapper broke stdin piping for hook event JSON. Changed to `memorix.cmd hook` which directly invokes the CMD shim and properly forwards stdin.
116
- - **CLI emoji removed** — All emoji in CLI output replaced with plain text markers (`[OK]`, `[FAIL]`, `[WARN]`, `[SKIP]`, `[DRY RUN]`) for enterprise-grade compatibility and to prevent future UTF-8 encoding issues.
117
-
118
- ## [0.9.25] — 2026-02-28
119
-
120
- ### Fixed
121
- - **Windsurf "no tools returned"** Transport-first architecture caused Windsurf to query `tools/list` before tools were registered. Normal path now registers tools first, then connects transport. Roots path (invalid cwd) still connects first to query `listRoots`.
122
- - **Windsurf rules not activated** — Generated `.windsurf/rules/memorix.md` lacked YAML frontmatter (`trigger: always_on`). Windsurf ignored the file without it. Also added `alwaysApply: true` frontmatter for Cursor `.mdc` files.
123
- - **Windsurf hook `post_command` content too short** — Normalizer didn't extract `commandOutput` from Windsurf `post_command` events, causing content to be <30 chars and filtered out.
124
- - **Hook hot-reload broken on Windows** `fs.watch()` lost track of `observations.json` after `atomicWriteFile` (which uses `rename()`). Switched to `fs.watchFile` with 2s polling for reliable cross-platform hot-reload. Hook-written memories are now searchable within ~4 seconds.
125
-
126
- ## [0.9.18] — 2026-02-26
127
-
128
- ### Fixed
129
- - **Self-referential command noise** — Bash commands that inspect memorix's own data (e.g. `node -e "...observations.json..."`, `cat ~/.memorix/...`) were being stored as observations, creating a feedback loop. Now filtered alongside `memorix_internal` tools.
130
-
131
- ## [0.9.17] 2026-02-26
132
-
133
- ### Fixed
134
- - **Session activity noise** Empty `session_end` events were unconditionally stored, generating ~8.5% of all observations as useless `"Session activity (discovery)"` entries. Now requires content ≥ 50 chars, matching the quality-first philosophy of 0.9.16.
135
-
136
- ## [0.9.16] 2026-02-26
137
-
138
- ### Architecture
139
- - **Classify → Policy → Store pipeline** — Replaced the monolithic `switch/case` handler (527 lines) with a clean declarative pipeline (432 lines). Inspired by claude-mem's store-first philosophy and mcp-memory-service's configurable scoring.
140
- - **Tool Taxonomy** `classifyTool()` categorizes tools into `file_modify | file_read | command | search | memorix_internal | unknown`. Each category has a declarative `StoragePolicy` (store mode, minLength, defaultType).
141
- - **Pattern detection = classification only** — Pattern detection now only determines observation *type* (decision, error, etc.), not whether to store. Storage decisions are made by policy.
142
- - **Unified `TYPE_EMOJI`** Single exported constant, eliminating 3 duplicated copies across handler and session_start.
143
-
144
- ### Fixed
145
- - **🔴 Critical: Bash commands with `cd` prefix silently dropped** — Claude Code sends Bash commands as `cd /project && npm test 2>&1`. The noise filter `/^cd\b/` matched the `cd` prefix and silently discarded the entire command. This caused `npm test`, `npm install express`, `node -e "..."`, and all other project-scoped commands to never be stored. Fix: `extractRealCommand()` strips `cd path && ` prefix before noise checking, so `cd /path && npm test` is correctly evaluated as `npm test`.
146
- - **Cooldown key too broad** — Old key `post_tool:Bash` meant ALL Bash commands shared one 30-second cooldown. New key uses `event:filePath|command|toolName`, so `npm test` and `npm install` have independent cooldowns.
147
- - **Store-first for commands** — Command-category tools now use `store: 'always'` policy with minLength 30 (down from 50-200), capturing more meaningful development activity.
148
-
149
- ## [0.9.15]2026-02-26
150
-
151
- ### Fixed
152
- - **Feedback visibility** — Hook auto-stores were silent. Now returns `systemMessage` to the agent after each save, e.g. `🟢 Memorix saved: Updated auth.ts [what-changed]`. Gives Codex-like visibility into what memorix is recording.
153
- - **File-modifying tools always store** — Write/Edit/MultiEdit tool events were rejected when content lacked pattern keywords (e.g., writing utility functions with no "error"/"fix" keywords). Now file-modifying tools always store if content > 100 chars, classified as `what-changed` by default.
154
- - **PreCompact low-quality spam** — PreCompact events stored empty/minimal observations with no meaningful content. Now requires `MIN_STORE_LENGTH` (100 chars) to store.
155
- - **Normalizer prompt extraction** `normalizeClaude` only extracted `prompt` for `user_prompt` events. Now extracts for all events (PreCompact, etc.), preserving context that would otherwise be lost.
156
-
157
- ## [0.9.14]2026-02-26
158
-
159
- ### Fixed
160
- - **🔴 Critical: Hooks never auto-store during development** — Two root causes:
161
- 1. `extractContent()` had a fatal `parts.length === 0` guard that skipped rich `toolInput` data (file content, edit diffs, commands) whenever `toolResult` was present. Since all agents send short `toolResult` like `"File written successfully"` (28 chars), the content was always < 100 chars and got rejected by `MIN_STORE_LENGTH`.
162
- 2. Bash/shell tool events (npm install, npm test, git commands) also got rejected because their content (~90 chars) fell below the generic `post_tool` threshold of 200 chars, even though commands are inherently meaningful.
163
- - **Fix**: Always extract `toolInput` fields alongside `toolResult`. Bash tools now use a dedicated low-threshold path (50 chars) with noise command filtering, matching the `post_command` logic.
164
-
165
- ### Added
166
- - **12 Claude Code E2E tests** Validates the full hook pipeline (stdin JSON → normalize → handleHookEvent → observation) for Write, Edit, Bash, UserPromptSubmit, SessionStart, Stop, PreCompact, and edge cases (noise filtering, memorix recursion skip, short prompts).
167
-
168
- ## [0.9.12] — 2026-02-25
169
-
170
- ### Fixed
171
- - **Copilot hooks format completely wrong** — Was reusing Claude Code's `generateClaudeConfig()` (PascalCase events, `command` field). Copilot requires `version: 1`, `bash`/`powershell` fields, `timeoutSec`, and camelCase event names (`sessionStart`, `userPromptSubmitted`, `preToolUse`, `postToolUse`, `sessionEnd`, `errorOccurred`). Now uses dedicated `generateCopilotConfig()`. Source: [GitHub Docs](https://docs.github.com/en/copilot/reference/hooks-configuration).
172
- - **Codex fake hooks.json removed** — Codex has no hooks system (only `notify` in config.toml for `agent-turn-complete`). Was generating a non-existent `.codex/hooks.json`. Now only installs rules (AGENTS.md). Source: [OpenAI Codex Config Reference](https://developers.openai.com/codex/config-reference/).
173
- - **Kiro hook file extension wrong** — Was `.hook.md`, should be `.kiro.hook`. Now generates 3 hook files: `memorix-agent-stop.kiro.hook` (session memory), `memorix-prompt-submit.kiro.hook` (context loading), `memorix-file-save.kiro.hook` (file change tracking). Source: [Kiro Docs](https://kiro.dev/docs/hooks/).
174
- - **Kiro only had 1 event** — Was only `file_saved`. Now covers `agent_stop`, `prompt_submit`, and `file_save` events.
175
-
176
- ### Added
177
- - **Antigravity/Gemini CLI hook installer** — New `generateGeminiConfig()` for `.gemini/settings.json`. PascalCase events (`SessionStart`, `AfterTool`, `AfterAgent`, `PreCompress`), timeout in milliseconds (10000ms). Source: [Gemini CLI Docs](https://geminicli.com/docs/hooks/).
178
- - **Copilot normalizer** — Dedicated `normalizeCopilot()` function with `inferCopilotEvent()` for payload-based event detection (Copilot sends typed payloads without explicit event names).
179
- - **Gemini CLI normalizer** — Dedicated `normalizeGemini()` function with event mapping for all 11 Gemini CLI events (`BeforeAgent`, `AfterAgent`, `BeforeTool`, `AfterTool`, `PreCompress`, etc.).
180
- - **Gemini CLI event mappings** Full EVENT_MAP entries for Gemini CLI PascalCase events → normalized events.
181
- - **Copilot event mappings** — EVENT_MAP entries for Copilot-specific camelCase events (`userPromptSubmitted`, `preToolUse`, `postToolUse`, `errorOccurred`).
182
-
183
- ## [0.9.11] 2026-02-25
184
-
185
- ### Fixed
186
- - **CLI crashes with `Dynamic require of "fs" is not supported`** When bundling CJS dependencies (like `gray-matter`) into ESM output via `noExternal`, esbuild's CJS-to-ESM wrapper couldn't resolve Node.js built-in modules. Added `createRequire` banner to provide a real `require` function before esbuild's wrapper runs, fixing `require('fs')` and other built-in module calls.
187
-
188
- ## [0.9.10] — 2026-02-25
189
-
190
- ### Fixed
191
- - **CLI crashes with `ERR_MODULE_NOT_FOUND` on global install** — `@orama/orama`, `gpt-tokenizer`, `gray-matter` and other dependencies were not bundled into the CLI output. tsup treated `dependencies` as external by default. Added `noExternal` to force-bundle all deps into CLI (275KB → 2.59MB), making `memorix hook` work reliably when installed globally via `npm install -g`.
192
- - **Cursor agent detection corrected** — Real Cursor payload confirmed to include `hook_event_name` + `conversation_id` (not just `workspace_roots`). Detection now uses `conversation_id` or `cursor_version` as primary discriminator vs Claude Code (which sends `session_id` without `conversation_id`). `extractEventName` reads `hook_event_name` first, falls back to payload inference.
193
-
194
- ## [0.9.9] — 2026-02-25
195
-
196
- ### Fixed
197
- - **Cursor hooks config format invalid** — Generated config was missing required `version` field and used objects instead of arrays for hook scripts. Cursor requires `{ version: 1, hooks: { eventName: [{ command: "..." }] } }` format. Added `sessionStart`, `beforeShellExecution`, `afterMCPExecution`, `preCompact` events.
198
- - **Cursor agent detection failed** Cursor does NOT send `hook_event_name` like Claude Code. Detection now uses Cursor-specific fields (`workspace_roots`, `is_background_agent`, `composer_mode`). Event type inferred from payload structure (e.g., `old_content`/`new_content` → `afterFileEdit`).
199
- - **Cursor `session_id` field not read** — Normalizer expected `conversation_id` but Cursor sends `session_id`. Now reads both with fallback.
200
-
201
- ## [0.9.8]2026-02-25
202
-
203
- ### Fixed
204
- - **Claude Code hooks installed to wrong file** Hooks were written to `.github/hooks/memorix.json` but Claude Code reads from `.claude/settings.local.json` (project-level) or `~/.claude/settings.json` (global). Now correctly writes to `.claude/settings.local.json` for project-level installation.
205
- - **Hooks merge overwrites existing settings** — Shallow spread `{...existing, ...generated}` would overwrite the entire `hooks` key, destroying user's other hook configurations. Now deep-merges the `hooks` object so existing hooks from other tools are preserved.
206
-
207
- ## [0.9.7]2026-02-25
208
-
209
- ### Fixed
210
- - **Claude Code hooks never triggering auto-memory** — Claude Code sends `hook_event_name` (snake_case) but the normalizer expected `hookEventName` (camelCase). This caused **every event** (SessionStart, UserPromptSubmit, PostToolUse, PreCompact, Stop) to be misidentified as `post_tool`, breaking event routing, prompt extraction, memory injection, and session tracking. Also fixed `session_id` → `sessionId` and `tool_response` → `toolResult` field mappings.
211
- - **Empty content extraction from Claude Code tool events** — `extractContent()` now unpacks `toolInput` fields (Bash commands, Write file content, etc.) when no other content is available. Previously tool events produced empty or near-empty content strings.
212
- - **User prompts silently dropped** — `MIN_STORE_LENGTH=100` was too high for typical user prompts. Added `MIN_PROMPT_LENGTH=20` specifically for `user_prompt` events.
213
- - **Post-tool events too aggressively filtered** — Tool events with substantial content (>200 chars) are now stored even without keyword pattern matches.
214
-
215
- ## [0.9.6] 2026-02-25
216
-
217
- ### Fixed
218
- - **Cross-IDE project identity fragmentation** — Data was stored in per-project subdirectories (`~/.memorix/data/<projectId>/`), but different IDEs often detected different projectIds for the same repo (e.g. `placeholder/repo` vs `local/repo` vs `local/Kiro`). This caused observations to silently split across directories, making cross-IDE relay unreliable. Now **all data is stored in a single flat directory** (`~/.memorix/data/`). projectId is metadata only, not used for directory partitioning. Existing per-project subdirectories are automatically merged on first startup (IDs remapped, graphs deduplicated, subdirs backed up to `.migrated-subdirs/`).
219
- - **`scope: 'project'` parameter now works** Previously accepted but ignored. Now properly filters search results by the current project's ID via Orama where-clause.
220
-
221
- ## [0.9.5] — 2026-02-25
222
-
223
- ### Fixed
224
- - **Claude Code hooks `matcher` format** `matcher` must be a **string** (tool name pattern like `"Bash"`, `"Edit|Write"`), not an object. For hooks that should fire on ALL events, `matcher` is now omitted entirely instead of using `{}`. Fixes `matcher: Expected string, but received object` validation error on Claude Code startup.
225
-
226
- ## [0.9.4] — 2026-02-25
227
-
228
- ### Fixed
229
- - **Codex/all-IDE `tools/list -> Method not found`** — Critical bug where `local/<dirname>` projects (any directory without a git remote) wrongly entered the MCP roots resolution flow. This flow connects the server *before* registering tools, so the MCP `initialize` handshake declared no `tools` capability, causing all subsequent `tools/list` calls to fail with "Method not found". Now only truly invalid projects (home dir, system dirs) enter the roots flow; `local/` projects go through the normal path (register tools first, then connect).
230
-
231
- ## [0.9.3] — 2026-02-25
232
-
233
- ### Fixed
234
- - **`memorix_timeline` "not found" bug** — Timeline was using unreliable Orama empty-term search. Now uses in-memory observations (same fix pattern as `memorix_detail`).
235
- - **`memorix_retention` "no observations found" bug** — Same root cause as timeline. Now uses in-memory observations for reliable document retrieval.
236
- - **`memorix_search` cross-IDE projectId mismatch** — Removed redundant projectId filter from search. Data isolation is already handled at the directory level. Different IDEs resolving different projectIds for the same directory no longer causes empty search results.
237
- - **Claude Code hooks format** — Updated `generateClaudeConfig` to use the new `{matcher: {}, hooks: [...]}` structure required by Claude Code 2025+. Fixes "Expected array, but received undefined" error on `memorix hooks install --agent claude --global`.
238
- - **EPERM `process.cwd()` crash** — All CLI commands (`serve`, `hooks install/uninstall/status`) now safely handle `process.cwd()` failures (e.g., deleted CWD on macOS) with fallback to home directory.
239
-
240
- ## [0.9.2]2026-02-25
241
-
242
- ### Fixed
243
- - **Empty directory support** — Memorix now starts successfully in any directory, even without `.git` or `package.json`. No more `__invalid__` project errors for brand new folders. Only truly dangerous directories (home dir, drive root, system dirs) are rejected.
244
- - **`findPackageRoot` safety** — Walking up from temp/nested directories no longer accidentally selects the home directory as project root.
245
-
246
- ### Changed
247
- - **README rewrite** — Complete rewrite of Quick Start section for both EN and 中文 READMEs:
248
- - Two-step install (global install + MCP config) instead of error-prone `npx`
249
- - Per-agent config examples (Claude Code, Cursor, Windsurf, etc.)
250
- - Troubleshooting table for common errors
251
- - AI-friendly: agents reading the README will now configure correctly on first try
252
-
253
- ## [0.9.1] 2026-02-25
254
-
255
- ### Fixed
256
- - **Defensive parameter coercion** — All 24 MCP tools now gracefully handle string-encoded arrays and numbers (e.g., `"[16]"` → `[16]`, `"20"` → `20`). Fixes compatibility with Claude Code CLI's known serialization bug ([#5504](https://github.com/anthropics/claude-code/issues/5504), [#26027](https://github.com/anthropics/claude-code/issues/26027)) and non-Anthropic models (GLM, etc.) that may produce incorrectly typed tool call arguments. Codex, Windsurf, and Cursor were already unaffected.
257
-
258
- ## [0.9.0] — 2026-02-24
259
-
260
- ### Added
261
- - **Memory Consolidation** (`memorix_consolidate`) Find and merge similar observations to reduce memory bloat. Uses Jaccard text similarity to cluster observations by entity+type, then merges them preserving all facts, files, and concepts. Supports `preview` (dry run) and `execute` modes with configurable similarity threshold.
262
- - **Temporal Queries** — `memorix_search` now supports `since` and `until` parameters for date range filtering. Example: "What auth decisions did we make last week?"
263
- - **Explainable Recall** Search results now include a `Matched` column showing which fields matched the query (title, entity, concept, narrative, fact, file, or fuzzy). Helps understand why each result was found.
264
- - **Export/Import** — Two new tools for team collaboration:
265
- - `memorix_export` — Export project observations and sessions as JSON (importable) or Markdown (human-readable for PRs/docs)
266
- - `memorix_import`Import from JSON export, re-assigns IDs, skips duplicate topicKeys
267
- - **Dashboard Sessions Panel** — New "Sessions" tab in the web dashboard with timeline view, active/completed counts, agent info, and session summaries. Bilingual (EN/中文).
268
- - **Auto sessionId** — `memorix_store` now automatically associates the current active session's ID with stored observations.
269
- - **16 new tests** 8 consolidation + 8 export/import (484 total).
270
-
271
- ### Stats
272
- - **MCP Tools:** 20 24 (memorix_consolidate, memorix_export, memorix_import + dashboard sessions API)
273
- - **Tests:** 484/484 passing
274
-
275
- ## [0.8.0]2026-02-24
276
-
277
- ### Added
278
- - **Session Lifecycle Management** — 3 new MCP tools for cross-session context continuity:
279
- - `memorix_session_start` — Start a coding session, auto-inject context from previous sessions (summaries + key observations). Previous active sessions are auto-closed.
280
- - `memorix_session_end`End a session with structured summary (Goal/Discoveries/Accomplished/Files format). Summary is injected into the next session.
281
- - `memorix_session_context`Manually retrieve session history and context (useful after compaction recovery).
282
- - **Topic Key Upsert** — `memorix_store` now accepts an optional `topicKey` parameter. When an observation with the same `topicKey + projectId` already exists, it is **updated in-place** instead of creating a duplicate. `revisionCount` increments on each upsert. Prevents data bloat for evolving decisions, architecture docs, etc.
283
- - **`memorix_suggest_topic_key` tool** Suggests stable topic keys from type + title using family heuristics (`architecture/*`, `bug/*`, `decision/*`, `config/*`, `discovery/*`, `pattern/*`). Supports CJK characters.
284
- - **Session persistence** — `sessions.json` with atomic writes and file locking for cross-process safety.
285
- - **Observation fields** — `topicKey`, `revisionCount`, `updatedAt`, `sessionId` added to `Observation` interface.
286
- - **30 new tests** — 16 session lifecycle tests + 14 topic key upsert tests (468 total).
287
-
288
- ### Improved
289
- - **`storeObservation` API** — Now returns `{ observation, upserted }` instead of just `Observation`, enabling callers to distinguish new vs updated observations.
290
-
291
- ### Inspired by
292
- - [Engram](https://github.com/alanbuscaglia/engram) — Session lifecycle design, topic_key upsert pattern, structured session summaries.
293
-
294
- ## [0.7.11] — 2026-02-24
295
-
296
- ### Added
297
- - **File locking & atomic writes** (`withFileLock`, `atomicWriteFile`) Cross-process safe writes for `observations.json`, `graph.jsonl`, and `counter.json`. Uses `.memorix.lock` directory lock with stale detection (10s timeout) and write-to-temp-then-rename for crash safety.
298
- - **Retention auto-archive** — `memorix_retention` tool now supports `action="archive"` to move expired observations to `observations.archived.json`. Reversible archived memories can be restored manually.
299
- - **Chinese entity extraction** — Entity extractor now recognizes Chinese identifiers in brackets (`「认证模块」`, `【数据库连接】`) and backticks, plus Chinese causal language patterns (因为/所以/由于/导致/决定/采用).
300
- - **Graph-memory bidirectional sync** — Dashboard DELETE now cleans up corresponding `[#id]` references from knowledge graph entities. Prevents orphaned data.
301
-
302
- ### Improved
303
- - **Search accuracy** — Added fuzzy tolerance, field boosting (title > entityName > concepts > narrative), lowered similarity threshold to 0.5, tuned hybrid weights (text 0.6, vector 0.4).
304
- - **Auto-relations performance** — Entity lookups now use O(1) index (`Map`) instead of O(n) `find()` on every observation store. `KnowledgeGraphManager` maintains a `entityIndex` rebuilt on create/delete mutations.
305
- - **Re-read-before-write** — `storeObservation` re-reads `observations.json` inside the lock before writing, merging concurrent changes instead of overwriting.
306
-
307
- ## [0.7.10] — 2026-02-24
308
-
309
- ### Added
310
- - **Chinese README** (`README.zh-CN.md`) Full bilingual documentation with language switcher at the top of both README files.
311
- - **Antigravity config guide** Collapsible note in README Quick Start and updated `docs/SETUP.md` Antigravity section explaining the `MEMORIX_PROJECT_ROOT` requirement, why it's needed (cwd + MCP roots both unavailable), and how to configure it.
312
- - **Project detection priority documentation** — Clear detection chain (`--cwd` → `MEMORIX_PROJECT_ROOT` → `INIT_CWD` → `process.cwd()` → MCP roots → error) in README, SETUP.md, and troubleshooting section.
313
-
314
- ## [0.7.9] — 2026-02-24
315
-
316
- ### Fixed
317
- - **Dashboard auto-switch when project changes** — When the dashboard is already running (started from project A) and `memorix_dashboard` is called from project B, the dashboard server's current project is now updated via a `/api/set-current-project` POST request before opening the browser. Previously, the dashboard always showed the project it was initially started with; now it correctly switches to the calling project. Existing browser tabs will also show the correct project on the next page load/refresh.
318
-
319
- ### Added
320
- - **MCP roots protocol support** — When the IDE's `cwd` is not a valid project (e.g., Antigravity sets cwd to `G:\Antigravity`), Memorix now automatically tries the MCP `roots/list` protocol to get the IDE's actual workspace path. This means standard MCP configs (`npx memorix@latest serve`) can work without `--cwd` in IDEs that support MCP roots. Falls back gracefully if the client doesn't support roots. Priority chain: `--cwd` > `MEMORIX_PROJECT_ROOT` > `INIT_CWD` > `process.cwd()` > **MCP roots** > error.
321
-
322
- ## [0.7.8] — 2026-02-24
323
-
324
- ### Fixed
325
- - **Graceful error on invalid project detection** When `detectProject()` returns `__invalid__` (e.g., IDE sets cwd to its own install directory like `G:\Antigravity`), the server now prints a clear, actionable error message with fix instructions (`--cwd` or `MEMORIX_PROJECT_ROOT`) instead of crashing with an opaque stack trace.
326
- - **Dashboard process liveness check** — `memorix_dashboard` now verifies the port is actually listening before returning "already running". If the dashboard process was killed externally (e.g., `taskkill`), it automatically restarts instead of opening a browser to a dead server.
327
-
328
- ### Added
329
- - **`MEMORIX_PROJECT_ROOT` environment variable** — New way to specify the project directory for IDEs that don't set `cwd` to the project path (e.g., Antigravity uses `G:\Antigravity` as cwd). Priority: `--cwd` > `MEMORIX_PROJECT_ROOT` > `INIT_CWD` > `process.cwd()`. Example MCP config: `"env": { "MEMORIX_PROJECT_ROOT": "e:/your/project" }`.
330
-
331
- ## [0.7.7]2026-02-24
332
-
333
- ### Fixed
334
- - **Wrong project detection in Antigravity/global MCP configs** Removed dangerous `scriptDir` fallback in `serve.ts` that caused the MCP server to detect the memorix development repo (or other wrong projects) instead of the user's actual project. When `process.cwd()` was not a git repo, the old code fell back to the memorix script's own directory, which could resolve to a completely unrelated project. Now relies solely on `detectProject()` which has proper fallback logic.
335
- - **Dashboard always showing wrong project** — When re-opening the dashboard (already running on port 3210), it now passes the current project as a `?project=` URL parameter. The frontend reads this parameter and auto-selects the correct project in the switcher, so opening dashboard from different IDEs/projects shows the right data.
336
-
337
- ## [0.7.6] — 2026-02-24
338
-
339
- ### Added
340
- - **`llms.txt` + `llms-full.txt`**Machine-readable project documentation for AI crawlers (2026 llms.txt standard). Helps Gemini, GPT, Claude, and other AI systems discover and understand Memorix automatically.
341
- - **FAQ semantic anchors in README** 7 Q&A entries matching common AI search queries ("How do I keep context when switching IDEs?", "Is there an MCP server for persistent AI coding memory?", etc.)
342
-
343
- ### Changed
344
- - **GitHub repo description** — Shortened to ~150 chars for optimal og:title/og:description generation
345
- - **GitHub topics** — 20 GEO-optimized tags including `cursor-mcp`, `windsurf-mcp`, `claude-code-memory`, `cross-ide-sync`, `context-persistence`, `agent-memory`
346
- - **package.json keywords** — Replaced generic tags with IDE-specific MCP entity-linking keywords
347
- - **package.json description** — Shortened to under 160 chars for better meta tag generation
348
- - **MCP tool descriptions** — Enhanced `memorix_store`, `memorix_search`, `memorix_workspace_sync`, `memorix_skills` with cross-IDE context so AI search engines understand what problems they solve
349
-
350
- ## [0.7.5] — 2026-02-22
351
-
352
- ### Changed
353
- - **README rewrite** — Completely restructured to focus on real-world scenarios, use cases, and features. Added 5 walkthrough scenarios, comparison table with alternatives, "Works with" badges for all 7 agents. Moved detailed config to sub-README.
354
- - **New `docs/SETUP.md`**Dedicated setup guide with agent-specific config, vector search setup, data storage, and troubleshooting
355
-
356
- ## [0.7.4] — 2026-02-22
357
-
358
- ### Fixed
359
- - **Hyphenated concepts not searchable** Concepts like `project-detection` and `bug-fix` are now normalized to `project detection` and `bug fix` in the search index so Orama's tokenizer can split them into individual searchable terms. Original observation data is preserved unchanged.
360
-
361
- ## [0.7.3]2026-02-22
362
-
363
- ### Fixed
364
- - **Windows: git remote detection fails due to "dubious ownership"** — Added `safe.directory=*` flag to all git commands so MCP subprocess can read git info regardless of directory ownership settings. If git CLI still fails, falls back to directly parsing `.git/config` file. This fixes projects incorrectly getting `local/<dirname>` instead of `owner/repo` as their project ID.
365
-
366
- ## [0.7.2]2026-02-22
367
-
368
- ### Fixed
369
- - **`memorix_workspace_sync` rejects `kiro` as target** Added `kiro` to `AGENT_TARGETS` enum (adapter was already implemented but missing from the tool's input schema)
370
- - **`memorix_rules_sync` missing `kiro` target** — Added `kiro` to `RULE_SOURCES` enum so Kiro steering rules can be generated as a sync target
371
- - **VS Code Copilot README config** — Separated `.vscode/mcp.json` (workspace) and `settings.json` (global) formats which have different JSON structures
372
-
373
- ## [0.7.1]2026-02-22
374
-
375
- ### Fixed
376
- - **Dashboard checkbox checkmark not visible** Added `position: relative/absolute` to `.obs-checkbox::after` so the ✓ renders correctly in batch select mode
377
- - **Embedding provider status flickers to "fulltext only"** — Replaced `initialized` boolean flag with a shared Promise lock; concurrent callers now wait for the same initialization instead of seeing `provider = null` mid-load
378
- - **`memorix_dashboard` MCP tool reliability** — Replaced fixed 800ms wait with TCP port polling (up to 5s) so the tool only returns after the HTTP server is actually listening
379
- - **Dashboard embedding status always shows "fulltext only"** — Fixed root cause: dashboard is an independent process, `isEmbeddingEnabled()` from orama-store always returns false there; now uses `provider !== null` directly
380
-
381
- ## [0.7.0] — 2026-02-21
382
-
383
- ### Added
384
- - **Memory-Driven Skills Engine** (`memorix_skills` MCP tool):
385
- - `list` — Discover all `SKILL.md` files across 7 agent directories
386
- - `generate` — Auto-generate project-specific skills from observation patterns (gotchas, decisions, how-it-works)
387
- - `inject` Return full skill content directly to agent context
388
- - Intelligent scoring: requires skill-worthy observation types, not just volume
389
- - Write to any target agent with `write: true, target: "<agent>"`
390
- - **Transformers.js Embedding Provider**:
391
- - Pure JavaScript fallback (`@huggingface/transformers`) no native deps required
392
- - Provider chain: `fastembed` → `transformers.js` → fulltext-only
393
- - Quantized model (`q8`) for small footprint
394
- - **Dashboard Enhancements**:
395
- - Canvas donut chart for observation type distribution
396
- - Embedding provider status card (enabled/provider/dimensions)
397
- - Search result highlighting with `<mark>` tags
398
- - **17 new tests** for Skills Engine (list, generate, inject, write, scoring, dedup)
399
-
400
- ### Changed
401
- - Scoring algorithm requires at least 1 skill-worthy type (gotcha/decision/how-it-works/problem-solution/trade-off) — pure discovery/what-changed entities won't generate skills
402
- - Volume bonus reduced from 2×obs to 1×obs (capped at 5) to favor quality over quantity
403
- - Type diversity bonus increased from 2 to 3 points per unique skill-worthy type
404
-
405
- ### Fixed
406
- - 422 tests passing (up from 405), 34 test files, zero regressions
407
-
408
- ## [0.5.0]2026-02-15
409
-
410
- ### Added
411
- - **Antigravity Adapter**: Full support for Antigravity/Gemini IDE (MCP config + rules)
412
- - **Copilot Adapter**: VS Code Copilot MCP config adapter + rules format adapter
413
- - **Comprehensive Documentation**: 7 developer docs in `docs/` (Architecture, Modules, API Reference, Design Decisions, Development Guide, Known Issues & Roadmap, AI Context)
414
- - **8 new npm keywords**: antigravity, mcp-tool, memory-layer, ai-memory, progressive-disclosure, orama, vector-search, bm25
415
- - `prepublishOnly` now runs `npm test` in addition to build
416
-
417
- ### Changed
418
- - README completely rewritten with clearer structure, npx zero-install setup, 6 agent configs, comparison table, Progressive Disclosure example, and architecture diagram
419
- - `description` field expanded for better npm search ranking
420
- - `files` array cleaned up (removed unused `examples` directory)
421
-
422
- ### Fixed
423
- - 274 tests passing (up from 219), zero regressions
424
-
425
- ## [0.1.0] — 2026-02-14
426
-
427
- ### Core
428
- - Knowledge Graph: Entity-Relation-Observation model (MCP Official compatible)
429
- - 3-Layer Progressive Disclosure: compact search → timeline → detail
430
- - 9 observation types with icon classification
431
- - Full-text search via Orama (BM25)
432
- - Per-project isolation via Git remote detection
433
- - 14 MCP tools (9 official + 5 Memorix extensions)
434
-
435
- ### Cross-Agent Sync
436
- - Rules Parser: 4 format adapters (Cursor, Claude Code, Codex, Windsurf)
437
- - Rules Syncer: scan → deduplicate → conflict detection → cross-format generation
438
- - Workspace Sync: MCP config migration + workflow sync + apply with backup/rollback
439
-
440
- ### Intelligence (Competitor-Inspired)
441
- - Access tracking: accessCount + lastAccessedAt (from mcp-memory-service)
442
- - Token budget: maxTokens search trimming (from MemCP)
443
- - Memory decay: exponential decay + retention lifecycle + immunity (from mcp-memory-service + MemCP)
444
- - Entity extraction: regex-based file/module/URL/CamelCase extraction (from MemCP)
445
- - Auto-enrichment: memorix_store auto-extracts and enriches concepts/files
446
- - Causal detection: "because/due to/caused by" pattern detection
447
- - Auto-relations: implicit Knowledge Graph relation creation (causes/fixes/modifies)
448
- - Retention status: memorix_retention MCP tool
449
-
450
- ### Vector Search
451
- - Embedding provider abstraction layer (extensible)
452
- - fastembed integration (optional, local ONNX, 384-dim bge-small)
453
- - Orama hybrid search mode (BM25 + vector)
454
- - Graceful degradation: no fastembed → fulltext only
455
- - Embedding cache (5000 entries LRU)
456
-
457
- ### Agent Instructions
458
- - CLAUDE.md: Claude Code usage instructions + lifecycle hooks
459
- - Example configs for Cursor, Windsurf, Codex
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.5] - 2026-03-24
6
+
7
+ ### Added
8
+ - **TUI workbench matured into a product-grade terminal UI** - Added an Ink-native `/configure` flow, interactive sidebar navigation, unified keyboard model, better no-project empty state, compact responsive layouts, and broader TUI interaction coverage.
9
+ - **Gemini CLI as a first-class integration target** - Added a dedicated Gemini CLI target across TUI integrate flows, workspace adapters, rules sync, hook normalization, and MCP config generation.
10
+ - **Release-blocker regression suite** - Added real embedded `serve-http` route tests for CORS and `/api/config`, plus cold-start CLI search regression coverage against persisted observations.
11
+ - **Silent auto-update wiring** - Wired the existing updater into real runtime entry points so TUI and HTTP control-plane starts can background-check and silently install newer npm releases without blocking startup.
12
+
13
+ ### Changed
14
+ - **Control plane stability and scope semantics** - Hardened HTTP project binding, dashboard API behavior, project-scoped health/search diagnostics, and release-readiness around multi-project sessions.
15
+ - **Product positioning and integration messaging** - Updated README, AI-facing docs, and agent/rules entry docs to foreground Memorix as an open-source cross-agent memory layer compatible with ten major coding IDEs and MCP hosts.
16
+ - **Search and retrieval transparency** - Search mode reporting is now project-scoped end-to-end, including TUI, embedded stats, and MCP search responses.
17
+ - **Session handoff semantics** - `memorix_session_start` now separates `Recent Handoff`, `Key Project Memories`, and `Recent Session History` so recency-first handoff context is no longer mixed with long-term importance-ranked memories.
18
+
19
+ ### Fixed
20
+ - **Embedded dashboard security and config isolation** - Fixed localhost-only CORS behavior for embedded dashboard JSON APIs and closed the `/api/config?project=...` startup-project YAML leak.
21
+ - **Cross-project retrieval correctness** - Fixed `memorix_detail` bare numeric IDs to remain project-safe instead of opening observations from another project.
22
+ - **Concurrent memory write consistency** - Fixed `topicKey` upsert races by rechecking authoritative disk state under the file lock before deciding whether to create or update.
23
+ - **CLI cold-start search regression** - Fixed `memorix search` so persisted observations are hydrated into the Orama index on a fresh process before searching.
24
+ - **Embedding provider resilience** - Fixed API embedding batch-limit handling with provider-aware chunking, automatic split-and-retry on oversized batches, and retry handling for transient 429/5xx errors.
25
+ - **OpenCode stale plugin detection** - Added generated-version markers and hook-status detection so outdated OpenCode plugin installs are surfaced and can be reinstalled before they corrupt the TUI experience.
26
+ - **Documentation encoding regressions** - Restored clean UTF-8 copy for Chinese README content and agent/rules entry docs so release docs match the current product shape.
27
+
28
+ ### Known Limitations
29
+ - **Gemini CLI / Antigravity shared `.gemini/*` ecosystem** - This follows the official Gemini ecosystem design. Integrations are independent at the target/adapter level, but hook runtime identity can still behave as "last installer wins" because both share the same official hook config surface.
30
+
31
+ ### Stats
32
+ - **Tests:** 1099/1101 passing (`82` files, `2` skipped)
33
+ - **Runtime surfaces covered before release:** stdio MCP, HTTP control plane, dashboard, TUI workbench, silent auto-update, Gemini CLI integration, git-hook ingest, and cold-start CLI search
34
+
35
+ ---
36
+
37
+ ## [1.0.4]2026-03-17
38
+
39
+ ### Added
40
+ - **Git Memory pipeline** — `git commit` can now flow directly into Memorix via `memorix git-hook`, `memorix git-hook-uninstall`, and `memorix ingest commit --auto`. Stored observations now carry `source` and `commitHash`, and Git memories can be filtered explicitly with `source: "git"`.
41
+ - **Reasoning Memory tools** — Added `memorix_store_reasoning` and `memorix_search_reasoning` so design rationale, alternatives, constraints, and risks can be stored and searched as a first-class memory layer.
42
+ - **Source-aware retrieval and cross-linking** — Search now boosts Git, reasoning, and problem-solution memories differently based on query intent. Git memories and reasoning memories can cross-reference each other via related commits and shared entities.
43
+ - **Structured config model** — Added project/user `memorix.yml`, project/user `.env` loading, `memorix init`, and configuration provenance diagnostics in `memorix status`.
44
+ - **Dashboard control plane upgrades** Added Git Memory, Config Provenance, and Identity Health views, plus richer stats and a stabilized graph layout for the HTTP dashboard.
45
+
46
+ ### Changed
47
+ - **Documentation consolidation** — Reworked README, README.zh-CN, setup, architecture, API reference, configuration, Git Memory, and development guides so they match the current product model: local-first platform, `memorix.yml + .env`, Git Memory, HTTP dashboard, and the four-layer architecture.
48
+ - **Project detection model** Project identity now centers on real Git roots, MCP roots support, system-directory fallback handling, and runtime project switching instead of older placeholder-style fallback identities.
49
+ - **Dashboard usage model** — `memorix serve-http --port 3211` is now the primary “control plane” entrypoint when you want HTTP transport, collaboration features, and dashboard access in one place.
50
+
51
+ ### Fixed
52
+ - **Project identity drift** — Fixed Codex/Windsurf startup issues that produced `local/System32`, IDE-installation-directory identities, or other incorrect local project bindings.
53
+ - **Worktree-safe Git hooks** — Hook installation, uninstall, auto-install checks, and status reporting now resolve hooks directories correctly for both normal repos and Git worktrees.
54
+ - **Runtime config correctness** — Fixed project-level `memorix.yml` not reaching runtime getters, `.env` values leaking across project switches, and legacy `config.json` not showing up correctly in provenance diagnostics.
55
+ - **Git Memory quality** — Added noise filtering, preserved release/version milestone commits, and implemented `memorix ingest commit --force` as an escape hatch for manual ingestion.
56
+ - **Cross-project detail retrieval** — Global search results can now be opened reliably with project-aware refs instead of colliding on observation IDs from different projects.
57
+ - **Skill generation noise** `memorix_skills generate` now filters low-signal command-history observations like `git`, `gh`, `npm`, and `npx` so generated skills stay project-relevant.
58
+ - **OpenCode static plugin noise** Merged the first external PR to silence `console.log` spam in the static OpenCode plugin without reintroducing session lifecycle side effects.
59
+ - **CI/publish flow** Restored CI green after type/test regressions and changed npm publishing workflow to manual trigger instead of automatic release publishing.
60
+
61
+ ### Stats
62
+ - **Tests:** 879/879 passing across 68 files
63
+ - **Runtime modes:** stdio MCP (`memorix serve`), HTTP MCP + dashboard (`memorix serve-http --port 3211`), and standalone dashboard remain supported
64
+
65
+ ---
66
+
67
+ ## [1.0.3] — 2026-03-14
68
+
69
+ ### Added
70
+ - **Memory Formation Pipeline** Three-stage pipeline (Extract → Resolve → Evaluate) runs in shadow mode on every `memorix_store` call and hooks trigger. Collects quality metrics without affecting storage decisions.
71
+ - **Extract**: Automatic fact extraction from narratives, title normalization, entity resolution against Knowledge Graph, observation type verification.
72
+ - **Resolve**: 4 resolution actions (new/merge/evolve/discard) based on similarity scoring, word overlap, and contradiction detection.
73
+ - **Evaluate**: Multi-factor knowledge value assessment (type weight, fact density, specificity, causal reasoning, noise detection). Categorizes memories as core/contextual/ephemeral.
74
+ - **`memorix_formation_metrics` tool** New MCP tool to query aggregated Formation Pipeline metrics (value scores, resolution actions, extraction rates, processing times).
75
+ - **`getEntityNames()` method** on `KnowledgeGraphManager` for Formation Pipeline entity resolution.
76
+
77
+ ### Stats
78
+ - **Default MCP Tools:** 23 (+1: `memorix_formation_metrics`)
79
+ - **Tests:** 803/803 passing across 60 files (+50 new Formation Pipeline tests)
80
+ - **Hooks safety:** handler.ts +21 lines (shadow call only), zero modification to existing hook logic
81
+
82
+ ---
83
+
84
+ ## [1.0.2] — 2026-03-14
85
+
86
+ ### Fixed
87
+ - **MCP Server version mismatch** — Server now reports the correct version from `package.json` (was hardcoded `0.1.0`). Injected at build time via tsup `define`.
88
+ - **CI Node.js matrix** — Removed Node 18 from CI matrix to match `engines: >=20` in `package.json`.
89
+ - **Orama reindex idempotency** — `reindexObservations()` now resets the Orama DB before rebuilding, eliminating "document already exists" errors in multi-session scenarios.
90
+ - **E2E tests no longer touch real user data** Mini-skills E2E tests now use a temporary directory with synthetic observations instead of reading/writing `~/.memorix/data/`.
91
+
92
+ ---
93
+
94
+ ## [1.0.1]2026-03-14
95
+
96
+ ### Fixed
97
+ - **OpenCode stdout pollution** — Removed all `console.log` / `console.error` from the generated OpenCode plugin template. Hooks now run fully silent. (fixes #15)
98
+ - **OpenCode session_id missing** — `normalizeOpenCode()` now reads `session_id` from the payload instead of hardcoding empty string. Plugin template generates and injects a stable session ID per plugin lifetime. (fixes #14)
99
+ - **Auto-install hooks scope** — Hooks are now only auto-installed for IDEs whose project-level config directory already exists (e.g., `.cursor/`, `.windsurf/`), preventing unwanted IDE directories from appearing in projects opened with a different IDE.
100
+
101
+ ### Added
102
+ - **`MEMORIX_DATA_DIR` environment variable** Override the default data directory (`~/.memorix/data/`) by setting `MEMORIX_DATA_DIR`. Applied consistently across persistence, alias registry, and embedding cache.
103
+
104
+ ---
105
+
106
+ ## [1.0.0] — 2026-03-09
107
+
108
+ ### 🎉 First Stable Release
109
+
110
+ Memorix reaches v1.0.0 — all major features complete. Future versions will iterate based on AI/agent ecosystem evolution.
111
+
112
+ ### Added
113
+ - **Multi-Agent Team Collaboration** — 4 team tools (`team_manage`, `team_file_lock`, `team_task`, `team_message`) for cross-IDE agent coordination. File-based persistence via `team-state.json`. Verified: Windsurf Antigravity bidirectional communication.
114
+ - **Auto-Cleanup on Startup** — Background retention archiving and intelligent deduplication run automatically in `deferredInit`. With LLM configured: semantic dedup via any OpenAI-compatible model. Without LLM: Jaccard similarity consolidation. Zero manual maintenance required.
115
+ - **`memorix_transfer` tool** — Merged `memorix_export` + `memorix_import` into a single tool with `action: "export" | "import"`.
116
+ - **TEAM.md** — Multi-agent coordination protocol documentation.
117
+
118
+ ### Changed
119
+ - **Tool consolidation: 41 → 22 default tools (-46%)**
120
+ - Team tools: 13 individual → 4 merged (action parameter pattern)
121
+ - Knowledge Graph tools: 9 conditional via `~/.memorix/settings.json` (`{ "knowledgeGraph": true }`)
122
+ - Export+Import: 2 1 (`memorix_transfer`)
123
+ - **Dashboard Team Panel** — Redesigned with Iconify icons, Material Design 3 style. Agent cards, task lists, message panel, file lock panel.
124
+ - **README updated** for v1.0.0 stable (EN + 中文).
125
+
126
+ ### Fixed
127
+ - **Windows EPERM file lock race condition** — Treat EPERM same as EEXIST in file-lock.ts.
128
+ - **PowerShell BOM in config.json** — `Set-Content -Encoding UTF8` adds BOM in PS 5.x, breaking `JSON.parse`. Always use Node.js for config file writes.
129
+
130
+ ### Production Hardening
131
+ - Cross-session shared team state
132
+ - Inbox capped at 200 messages with auto-eviction
133
+ - Session timeout GC (30min idle → auto-close)
134
+ - Send to inactive agent rejected
135
+ - Agent leave releases file locks + clears inbox
136
+ - Orphaned task rescue when assignee inactive
137
+ - Input validation: agent name max 100, message max 10KB
138
+
139
+ ### Stats
140
+ - **Default MCP Tools:** 22 (+9 optional KG)
141
+ - **Tests:** 753/753 passing across 56 files
142
+ - **IDE Support:** 10 agents (Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, Antigravity, OpenCode, Trae, Gemini CLI)
143
+
144
+ ## [0.12.0] — 2026-03-08
145
+
146
+ ### Added
147
+ - **Intent-Aware Recall** — Search understands query intent ("why X?" prioritizes decisions/trade-offs, "how to X?" prioritizes how-it-works).
148
+ - **MCP Deadlock Fix** — Resolved stdio transport deadlock under high concurrency.
149
+ - **Dashboard Dark Theme Fix** Proper dark mode support across all panels.
150
+ - **Build Race Condition Fix** — Fixed tsup parallel build race condition.
151
+
152
+ ## [0.11.0] 2026-03-07
153
+
154
+ ### Added
155
+ - **Mini-Skills** (`memorix_promote`) Promote observations to permanent skills that auto-inject at session start. Never decay, project-scoped.
156
+ - **LLM Quality Engine** — Compact-on-write (duplicate detection at write time), narrative compression (~27% token reduction), search reranking (60% queries improved).
157
+ - **`memorix_deduplicate` tool** LLM-powered semantic deduplication with dry-run support.
158
+ - **`memorix_resolve` tool** — Mark completed tasks and fixed bugs as resolved to prevent context pollution.
159
+
160
+ ### Fixed
161
+ - **Retention decay fix** Reclassified `what-changed`/`discovery` to low retention (30d instead of 90d).
162
+
163
+ ### Stats
164
+ - **Tests:** 641 → 674 passing
165
+
166
+ ## [0.10.6]2026-03-06
167
+
168
+ ### Fixed
169
+ - Minor stability improvements.
170
+
171
+ ## [0.10.5] 2026-03-05
172
+
173
+ ### Fixed
174
+ - **🔴 Critical: Antigravity MCP connection failure** — CLI banner (starting with 🧠 emoji, UTF-8 `F0 9F A7 A0`) was written to `stdout` via `console.log` in the non-interactive branch. When `citty` dispatches to `serve` subcommand, it calls parent `run()` first, polluting the MCP JSON-RPC stream. Go's `encoding/json` in Antigravity failed on the first byte `0xF0` with `invalid character 'ð'`. Fix: `console.log` → `console.error` for all CLI banner output.
175
+ - **🔴 Critical: Claude Code Stop hook schema validation failure** — `hookSpecificOutput` was returned for all hook events, but Claude Code only supports it for `PreToolUse`, `UserPromptSubmit`, and `PostToolUse`. Events like `SessionStart`, `Stop`, and `PreCompact` with `hookSpecificOutput` triggered `JSON validation failed: Invalid input`. Fix: only include `hookSpecificOutput` for the 3 supported event types.
176
+ - **Claude Code hook_event_name not read** — Handler read `payload.hookEventName` (camelCase) but Claude Code sends `hook_event_name` (snake_case), causing `hookEventName` to always be empty and `hookSpecificOutput` to be `{}`.
177
+ - **Windows hook stdin piping broken** — `cmd /c memorix hook` wrapper broke stdin piping for hook event JSON. Changed to `memorix.cmd hook` which directly invokes the CMD shim and properly forwards stdin.
178
+ - **CLI emoji removed** — All emoji in CLI output replaced with plain text markers (`[OK]`, `[FAIL]`, `[WARN]`, `[SKIP]`, `[DRY RUN]`) for enterprise-grade compatibility and to prevent future UTF-8 encoding issues.
179
+
180
+ ## [0.9.25]2026-02-28
181
+
182
+ ### Fixed
183
+ - **Windsurf "no tools returned"** — Transport-first architecture caused Windsurf to query `tools/list` before tools were registered. Normal path now registers tools first, then connects transport. Roots path (invalid cwd) still connects first to query `listRoots`.
184
+ - **Windsurf rules not activated** — Generated `.windsurf/rules/memorix.md` lacked YAML frontmatter (`trigger: always_on`). Windsurf ignored the file without it. Also added `alwaysApply: true` frontmatter for Cursor `.mdc` files.
185
+ - **Windsurf hook `post_command` content too short** — Normalizer didn't extract `commandOutput` from Windsurf `post_command` events, causing content to be <30 chars and filtered out.
186
+ - **Hook hot-reload broken on Windows** `fs.watch()` lost track of `observations.json` after `atomicWriteFile` (which uses `rename()`). Switched to `fs.watchFile` with 2s polling for reliable cross-platform hot-reload. Hook-written memories are now searchable within ~4 seconds.
187
+
188
+ ## [0.9.18] — 2026-02-26
189
+
190
+ ### Fixed
191
+ - **Self-referential command noise** — Bash commands that inspect memorix's own data (e.g. `node -e "...observations.json..."`, `cat ~/.memorix/...`) were being stored as observations, creating a feedback loop. Now filtered alongside `memorix_internal` tools.
192
+
193
+ ## [0.9.17] — 2026-02-26
194
+
195
+ ### Fixed
196
+ - **Session activity noise** — Empty `session_end` events were unconditionally stored, generating ~8.5% of all observations as useless `"Session activity (discovery)"` entries. Now requires content ≥ 50 chars, matching the quality-first philosophy of 0.9.16.
197
+
198
+ ## [0.9.16]2026-02-26
199
+
200
+ ### Architecture
201
+ - **Classify → Policy → Store pipeline** Replaced the monolithic `switch/case` handler (527 lines) with a clean declarative pipeline (432 lines). Inspired by claude-mem's store-first philosophy and mcp-memory-service's configurable scoring.
202
+ - **Tool Taxonomy** — `classifyTool()` categorizes tools into `file_modify | file_read | command | search | memorix_internal | unknown`. Each category has a declarative `StoragePolicy` (store mode, minLength, defaultType).
203
+ - **Pattern detection = classification only** — Pattern detection now only determines observation *type* (decision, error, etc.), not whether to store. Storage decisions are made by policy.
204
+ - **Unified `TYPE_EMOJI`**Single exported constant, eliminating 3 duplicated copies across handler and session_start.
205
+
206
+ ### Fixed
207
+ - **🔴 Critical: Bash commands with `cd` prefix silently dropped** Claude Code sends Bash commands as `cd /project && npm test 2>&1`. The noise filter `/^cd\b/` matched the `cd` prefix and silently discarded the entire command. This caused `npm test`, `npm install express`, `node -e "..."`, and all other project-scoped commands to never be stored. Fix: `extractRealCommand()` strips `cd path && ` prefix before noise checking, so `cd /path && npm test` is correctly evaluated as `npm test`.
208
+ - **Cooldown key too broad** — Old key `post_tool:Bash` meant ALL Bash commands shared one 30-second cooldown. New key uses `event:filePath|command|toolName`, so `npm test` and `npm install` have independent cooldowns.
209
+ - **Store-first for commands** — Command-category tools now use `store: 'always'` policy with minLength 30 (down from 50-200), capturing more meaningful development activity.
210
+
211
+ ## [0.9.15] 2026-02-26
212
+
213
+ ### Fixed
214
+ - **Feedback visibility** — Hook auto-stores were silent. Now returns `systemMessage` to the agent after each save, e.g. `🟢 Memorix saved: Updated auth.ts [what-changed]`. Gives Codex-like visibility into what memorix is recording.
215
+ - **File-modifying tools always store** — Write/Edit/MultiEdit tool events were rejected when content lacked pattern keywords (e.g., writing utility functions with no "error"/"fix" keywords). Now file-modifying tools always store if content > 100 chars, classified as `what-changed` by default.
216
+ - **PreCompact low-quality spam** — PreCompact events stored empty/minimal observations with no meaningful content. Now requires `MIN_STORE_LENGTH` (100 chars) to store.
217
+ - **Normalizer prompt extraction** — `normalizeClaude` only extracted `prompt` for `user_prompt` events. Now extracts for all events (PreCompact, etc.), preserving context that would otherwise be lost.
218
+
219
+ ## [0.9.14]2026-02-26
220
+
221
+ ### Fixed
222
+ - **🔴 Critical: Hooks never auto-store during development** — Two root causes:
223
+ 1. `extractContent()` had a fatal `parts.length === 0` guard that skipped rich `toolInput` data (file content, edit diffs, commands) whenever `toolResult` was present. Since all agents send short `toolResult` like `"File written successfully"` (28 chars), the content was always < 100 chars and got rejected by `MIN_STORE_LENGTH`.
224
+ 2. Bash/shell tool events (npm install, npm test, git commands) also got rejected because their content (~90 chars) fell below the generic `post_tool` threshold of 200 chars, even though commands are inherently meaningful.
225
+ - **Fix**: Always extract `toolInput` fields alongside `toolResult`. Bash tools now use a dedicated low-threshold path (50 chars) with noise command filtering, matching the `post_command` logic.
226
+
227
+ ### Added
228
+ - **12 Claude Code E2E tests** — Validates the full hook pipeline (stdin JSON → normalize → handleHookEvent → observation) for Write, Edit, Bash, UserPromptSubmit, SessionStart, Stop, PreCompact, and edge cases (noise filtering, memorix recursion skip, short prompts).
229
+
230
+ ## [0.9.12] — 2026-02-25
231
+
232
+ ### Fixed
233
+ - **Copilot hooks format completely wrong** — Was reusing Claude Code's `generateClaudeConfig()` (PascalCase events, `command` field). Copilot requires `version: 1`, `bash`/`powershell` fields, `timeoutSec`, and camelCase event names (`sessionStart`, `userPromptSubmitted`, `preToolUse`, `postToolUse`, `sessionEnd`, `errorOccurred`). Now uses dedicated `generateCopilotConfig()`. Source: [GitHub Docs](https://docs.github.com/en/copilot/reference/hooks-configuration).
234
+ - **Codex fake hooks.json removed** — Codex has no hooks system (only `notify` in config.toml for `agent-turn-complete`). Was generating a non-existent `.codex/hooks.json`. Now only installs rules (AGENTS.md). Source: [OpenAI Codex Config Reference](https://developers.openai.com/codex/config-reference/).
235
+ - **Kiro hook file extension wrong** — Was `.hook.md`, should be `.kiro.hook`. Now generates 3 hook files: `memorix-agent-stop.kiro.hook` (session memory), `memorix-prompt-submit.kiro.hook` (context loading), `memorix-file-save.kiro.hook` (file change tracking). Source: [Kiro Docs](https://kiro.dev/docs/hooks/).
236
+ - **Kiro only had 1 event** — Was only `file_saved`. Now covers `agent_stop`, `prompt_submit`, and `file_save` events.
237
+
238
+ ### Added
239
+ - **Antigravity/Gemini CLI hook installer** — New `generateGeminiConfig()` for `.gemini/settings.json`. PascalCase events (`SessionStart`, `AfterTool`, `AfterAgent`, `PreCompress`), timeout in milliseconds (10000ms). Source: [Gemini CLI Docs](https://geminicli.com/docs/hooks/).
240
+ - **Copilot normalizer** Dedicated `normalizeCopilot()` function with `inferCopilotEvent()` for payload-based event detection (Copilot sends typed payloads without explicit event names).
241
+ - **Gemini CLI normalizer** — Dedicated `normalizeGemini()` function with event mapping for all 11 Gemini CLI events (`BeforeAgent`, `AfterAgent`, `BeforeTool`, `AfterTool`, `PreCompress`, etc.).
242
+ - **Gemini CLI event mappings** — Full EVENT_MAP entries for Gemini CLI PascalCase events → normalized events.
243
+ - **Copilot event mappings** — EVENT_MAP entries for Copilot-specific camelCase events (`userPromptSubmitted`, `preToolUse`, `postToolUse`, `errorOccurred`).
244
+
245
+ ## [0.9.11] — 2026-02-25
246
+
247
+ ### Fixed
248
+ - **CLI crashes with `Dynamic require of "fs" is not supported`** — When bundling CJS dependencies (like `gray-matter`) into ESM output via `noExternal`, esbuild's CJS-to-ESM wrapper couldn't resolve Node.js built-in modules. Added `createRequire` banner to provide a real `require` function before esbuild's wrapper runs, fixing `require('fs')` and other built-in module calls.
249
+
250
+ ## [0.9.10] 2026-02-25
251
+
252
+ ### Fixed
253
+ - **CLI crashes with `ERR_MODULE_NOT_FOUND` on global install** — `@orama/orama`, `gpt-tokenizer`, `gray-matter` and other dependencies were not bundled into the CLI output. tsup treated `dependencies` as external by default. Added `noExternal` to force-bundle all deps into CLI (275KB → 2.59MB), making `memorix hook` work reliably when installed globally via `npm install -g`.
254
+ - **Cursor agent detection corrected** — Real Cursor payload confirmed to include `hook_event_name` + `conversation_id` (not just `workspace_roots`). Detection now uses `conversation_id` or `cursor_version` as primary discriminator vs Claude Code (which sends `session_id` without `conversation_id`). `extractEventName` reads `hook_event_name` first, falls back to payload inference.
255
+
256
+ ## [0.9.9] 2026-02-25
257
+
258
+ ### Fixed
259
+ - **Cursor hooks config format invalid** — Generated config was missing required `version` field and used objects instead of arrays for hook scripts. Cursor requires `{ version: 1, hooks: { eventName: [{ command: "..." }] } }` format. Added `sessionStart`, `beforeShellExecution`, `afterMCPExecution`, `preCompact` events.
260
+ - **Cursor agent detection failed** — Cursor does NOT send `hook_event_name` like Claude Code. Detection now uses Cursor-specific fields (`workspace_roots`, `is_background_agent`, `composer_mode`). Event type inferred from payload structure (e.g., `old_content`/`new_content` → `afterFileEdit`).
261
+ - **Cursor `session_id` field not read** Normalizer expected `conversation_id` but Cursor sends `session_id`. Now reads both with fallback.
262
+
263
+ ## [0.9.8]2026-02-25
264
+
265
+ ### Fixed
266
+ - **Claude Code hooks installed to wrong file** Hooks were written to `.github/hooks/memorix.json` but Claude Code reads from `.claude/settings.local.json` (project-level) or `~/.claude/settings.json` (global). Now correctly writes to `.claude/settings.local.json` for project-level installation.
267
+ - **Hooks merge overwrites existing settings** — Shallow spread `{...existing, ...generated}` would overwrite the entire `hooks` key, destroying user's other hook configurations. Now deep-merges the `hooks` object so existing hooks from other tools are preserved.
268
+
269
+ ## [0.9.7]2026-02-25
270
+
271
+ ### Fixed
272
+ - **Claude Code hooks never triggering auto-memory** — Claude Code sends `hook_event_name` (snake_case) but the normalizer expected `hookEventName` (camelCase). This caused **every event** (SessionStart, UserPromptSubmit, PostToolUse, PreCompact, Stop) to be misidentified as `post_tool`, breaking event routing, prompt extraction, memory injection, and session tracking. Also fixed `session_id` → `sessionId` and `tool_response` → `toolResult` field mappings.
273
+ - **Empty content extraction from Claude Code tool events** — `extractContent()` now unpacks `toolInput` fields (Bash commands, Write file content, etc.) when no other content is available. Previously tool events produced empty or near-empty content strings.
274
+ - **User prompts silently dropped** — `MIN_STORE_LENGTH=100` was too high for typical user prompts. Added `MIN_PROMPT_LENGTH=20` specifically for `user_prompt` events.
275
+ - **Post-tool events too aggressively filtered** Tool events with substantial content (>200 chars) are now stored even without keyword pattern matches.
276
+
277
+ ## [0.9.6] — 2026-02-25
278
+
279
+ ### Fixed
280
+ - **Cross-IDE project identity fragmentation** Data was stored in per-project subdirectories (`~/.memorix/data/<projectId>/`), but different IDEs often detected different projectIds for the same repo (e.g. `placeholder/repo` vs `local/repo` vs `local/Kiro`). This caused observations to silently split across directories, making cross-IDE relay unreliable. Now **all data is stored in a single flat directory** (`~/.memorix/data/`). projectId is metadata only, not used for directory partitioning. Existing per-project subdirectories are automatically merged on first startup (IDs remapped, graphs deduplicated, subdirs backed up to `.migrated-subdirs/`).
281
+ - **`scope: 'project'` parameter now works** Previously accepted but ignored. Now properly filters search results by the current project's ID via Orama where-clause.
282
+
283
+ ## [0.9.5]2026-02-25
284
+
285
+ ### Fixed
286
+ - **Claude Code hooks `matcher` format** — `matcher` must be a **string** (tool name pattern like `"Bash"`, `"Edit|Write"`), not an object. For hooks that should fire on ALL events, `matcher` is now omitted entirely instead of using `{}`. Fixes `matcher: Expected string, but received object` validation error on Claude Code startup.
287
+
288
+ ## [0.9.4] — 2026-02-25
289
+
290
+ ### Fixed
291
+ - **Codex/all-IDE `tools/list -> Method not found`** — Critical bug where `local/<dirname>` projects (any directory without a git remote) wrongly entered the MCP roots resolution flow. This flow connects the server *before* registering tools, so the MCP `initialize` handshake declared no `tools` capability, causing all subsequent `tools/list` calls to fail with "Method not found". Now only truly invalid projects (home dir, system dirs) enter the roots flow; `local/` projects go through the normal path (register tools first, then connect).
292
+
293
+ ## [0.9.3] — 2026-02-25
294
+
295
+ ### Fixed
296
+ - **`memorix_timeline` "not found" bug** — Timeline was using unreliable Orama empty-term search. Now uses in-memory observations (same fix pattern as `memorix_detail`).
297
+ - **`memorix_retention` "no observations found" bug** — Same root cause as timeline. Now uses in-memory observations for reliable document retrieval.
298
+ - **`memorix_search` cross-IDE projectId mismatch** — Removed redundant projectId filter from search. Data isolation is already handled at the directory level. Different IDEs resolving different projectIds for the same directory no longer causes empty search results.
299
+ - **Claude Code hooks format** — Updated `generateClaudeConfig` to use the new `{matcher: {}, hooks: [...]}` structure required by Claude Code 2025+. Fixes "Expected array, but received undefined" error on `memorix hooks install --agent claude --global`.
300
+ - **EPERM `process.cwd()` crash** — All CLI commands (`serve`, `hooks install/uninstall/status`) now safely handle `process.cwd()` failures (e.g., deleted CWD on macOS) with fallback to home directory.
301
+
302
+ ## [0.9.2] — 2026-02-25
303
+
304
+ ### Fixed
305
+ - **Empty directory support** — Memorix now starts successfully in any directory, even without `.git` or `package.json`. No more `__invalid__` project errors for brand new folders. Only truly dangerous directories (home dir, drive root, system dirs) are rejected.
306
+ - **`findPackageRoot` safety** — Walking up from temp/nested directories no longer accidentally selects the home directory as project root.
307
+
308
+ ### Changed
309
+ - **README rewrite** — Complete rewrite of Quick Start section for both EN and 中文 READMEs:
310
+ - Two-step install (global install + MCP config) instead of error-prone `npx`
311
+ - Per-agent config examples (Claude Code, Cursor, Windsurf, etc.)
312
+ - Troubleshooting table for common errors
313
+ - AI-friendly: agents reading the README will now configure correctly on first try
314
+
315
+ ## [0.9.1] — 2026-02-25
316
+
317
+ ### Fixed
318
+ - **Defensive parameter coercion** — All 24 MCP tools now gracefully handle string-encoded arrays and numbers (e.g., `"[16]"` → `[16]`, `"20"` → `20`). Fixes compatibility with Claude Code CLI's known serialization bug ([#5504](https://github.com/anthropics/claude-code/issues/5504), [#26027](https://github.com/anthropics/claude-code/issues/26027)) and non-Anthropic models (GLM, etc.) that may produce incorrectly typed tool call arguments. Codex, Windsurf, and Cursor were already unaffected.
319
+
320
+ ## [0.9.0] 2026-02-24
321
+
322
+ ### Added
323
+ - **Memory Consolidation** (`memorix_consolidate`) — Find and merge similar observations to reduce memory bloat. Uses Jaccard text similarity to cluster observations by entity+type, then merges them preserving all facts, files, and concepts. Supports `preview` (dry run) and `execute` modes with configurable similarity threshold.
324
+ - **Temporal Queries** — `memorix_search` now supports `since` and `until` parameters for date range filtering. Example: "What auth decisions did we make last week?"
325
+ - **Explainable Recall** Search results now include a `Matched` column showing which fields matched the query (title, entity, concept, narrative, fact, file, or fuzzy). Helps understand why each result was found.
326
+ - **Export/Import** — Two new tools for team collaboration:
327
+ - `memorix_export` — Export project observations and sessions as JSON (importable) or Markdown (human-readable for PRs/docs)
328
+ - `memorix_import` — Import from JSON export, re-assigns IDs, skips duplicate topicKeys
329
+ - **Dashboard Sessions Panel** — New "Sessions" tab in the web dashboard with timeline view, active/completed counts, agent info, and session summaries. Bilingual (EN/中文).
330
+ - **Auto sessionId** — `memorix_store` now automatically associates the current active session's ID with stored observations.
331
+ - **16 new tests** 8 consolidation + 8 export/import (484 total).
332
+
333
+ ### Stats
334
+ - **MCP Tools:** 20 24 (memorix_consolidate, memorix_export, memorix_import + dashboard sessions API)
335
+ - **Tests:** 484/484 passing
336
+
337
+ ## [0.8.0] — 2026-02-24
338
+
339
+ ### Added
340
+ - **Session Lifecycle Management**3 new MCP tools for cross-session context continuity:
341
+ - `memorix_session_start`Start a coding session, auto-inject context from previous sessions (summaries + key observations). Previous active sessions are auto-closed.
342
+ - `memorix_session_end` — End a session with structured summary (Goal/Discoveries/Accomplished/Files format). Summary is injected into the next session.
343
+ - `memorix_session_context` — Manually retrieve session history and context (useful after compaction recovery).
344
+ - **Topic Key Upsert** — `memorix_store` now accepts an optional `topicKey` parameter. When an observation with the same `topicKey + projectId` already exists, it is **updated in-place** instead of creating a duplicate. `revisionCount` increments on each upsert. Prevents data bloat for evolving decisions, architecture docs, etc.
345
+ - **`memorix_suggest_topic_key` tool** — Suggests stable topic keys from type + title using family heuristics (`architecture/*`, `bug/*`, `decision/*`, `config/*`, `discovery/*`, `pattern/*`). Supports CJK characters.
346
+ - **Session persistence** — `sessions.json` with atomic writes and file locking for cross-process safety.
347
+ - **Observation fields** — `topicKey`, `revisionCount`, `updatedAt`, `sessionId` added to `Observation` interface.
348
+ - **30 new tests** — 16 session lifecycle tests + 14 topic key upsert tests (468 total).
349
+
350
+ ### Improved
351
+ - **`storeObservation` API** — Now returns `{ observation, upserted }` instead of just `Observation`, enabling callers to distinguish new vs updated observations.
352
+
353
+ ### Inspired by
354
+ - [Engram](https://github.com/alanbuscaglia/engram)Session lifecycle design, topic_key upsert pattern, structured session summaries.
355
+
356
+ ## [0.7.11] — 2026-02-24
357
+
358
+ ### Added
359
+ - **File locking & atomic writes** (`withFileLock`, `atomicWriteFile`) Cross-process safe writes for `observations.json`, `graph.jsonl`, and `counter.json`. Uses `.memorix.lock` directory lock with stale detection (10s timeout) and write-to-temp-then-rename for crash safety.
360
+ - **Retention auto-archive** — `memorix_retention` tool now supports `action="archive"` to move expired observations to `observations.archived.json`. Reversible — archived memories can be restored manually.
361
+ - **Chinese entity extraction** Entity extractor now recognizes Chinese identifiers in brackets (`「认证模块」`, `【数据库连接】`) and backticks, plus Chinese causal language patterns (因为/所以/由于/导致/决定/采用).
362
+ - **Graph-memory bidirectional sync** — Dashboard DELETE now cleans up corresponding `[#id]` references from knowledge graph entities. Prevents orphaned data.
363
+
364
+ ### Improved
365
+ - **Search accuracy** — Added fuzzy tolerance, field boosting (title > entityName > concepts > narrative), lowered similarity threshold to 0.5, tuned hybrid weights (text 0.6, vector 0.4).
366
+ - **Auto-relations performance** Entity lookups now use O(1) index (`Map`) instead of O(n) `find()` on every observation store. `KnowledgeGraphManager` maintains a `entityIndex` rebuilt on create/delete mutations.
367
+ - **Re-read-before-write** — `storeObservation` re-reads `observations.json` inside the lock before writing, merging concurrent changes instead of overwriting.
368
+
369
+ ## [0.7.10]2026-02-24
370
+
371
+ ### Added
372
+ - **Chinese README** (`README.zh-CN.md`) — Full bilingual documentation with language switcher at the top of both README files.
373
+ - **Antigravity config guide** Collapsible note in README Quick Start and updated `docs/SETUP.md` Antigravity section explaining the `MEMORIX_PROJECT_ROOT` requirement, why it's needed (cwd + MCP roots both unavailable), and how to configure it.
374
+ - **Project detection priority documentation** — Clear detection chain (`--cwd` → `MEMORIX_PROJECT_ROOT` → `INIT_CWD` → `process.cwd()` → MCP roots → error) in README, SETUP.md, and troubleshooting section.
375
+
376
+ ## [0.7.9]2026-02-24
377
+
378
+ ### Fixed
379
+ - **Dashboard auto-switch when project changes** — When the dashboard is already running (started from project A) and `memorix_dashboard` is called from project B, the dashboard server's current project is now updated via a `/api/set-current-project` POST request before opening the browser. Previously, the dashboard always showed the project it was initially started with; now it correctly switches to the calling project. Existing browser tabs will also show the correct project on the next page load/refresh.
380
+
381
+ ### Added
382
+ - **MCP roots protocol support** — When the IDE's `cwd` is not a valid project (e.g., Antigravity sets cwd to `G:\Antigravity`), Memorix now automatically tries the MCP `roots/list` protocol to get the IDE's actual workspace path. This means standard MCP configs (`npx memorix@latest serve`) can work without `--cwd` in IDEs that support MCP roots. Falls back gracefully if the client doesn't support roots. Priority chain: `--cwd` > `MEMORIX_PROJECT_ROOT` > `INIT_CWD` > `process.cwd()` > **MCP roots** > error.
383
+
384
+ ## [0.7.8] 2026-02-24
385
+
386
+ ### Fixed
387
+ - **Graceful error on invalid project detection** — When `detectProject()` returns `__invalid__` (e.g., IDE sets cwd to its own install directory like `G:\Antigravity`), the server now prints a clear, actionable error message with fix instructions (`--cwd` or `MEMORIX_PROJECT_ROOT`) instead of crashing with an opaque stack trace.
388
+ - **Dashboard process liveness check** `memorix_dashboard` now verifies the port is actually listening before returning "already running". If the dashboard process was killed externally (e.g., `taskkill`), it automatically restarts instead of opening a browser to a dead server.
389
+
390
+ ### Added
391
+ - **`MEMORIX_PROJECT_ROOT` environment variable** — New way to specify the project directory for IDEs that don't set `cwd` to the project path (e.g., Antigravity uses `G:\Antigravity` as cwd). Priority: `--cwd` > `MEMORIX_PROJECT_ROOT` > `INIT_CWD` > `process.cwd()`. Example MCP config: `"env": { "MEMORIX_PROJECT_ROOT": "e:/your/project" }`.
392
+
393
+ ## [0.7.7] 2026-02-24
394
+
395
+ ### Fixed
396
+ - **Wrong project detection in Antigravity/global MCP configs** — Removed dangerous `scriptDir` fallback in `serve.ts` that caused the MCP server to detect the memorix development repo (or other wrong projects) instead of the user's actual project. When `process.cwd()` was not a git repo, the old code fell back to the memorix script's own directory, which could resolve to a completely unrelated project. Now relies solely on `detectProject()` which has proper fallback logic.
397
+ - **Dashboard always showing wrong project** — When re-opening the dashboard (already running on port 3210), it now passes the current project as a `?project=` URL parameter. The frontend reads this parameter and auto-selects the correct project in the switcher, so opening dashboard from different IDEs/projects shows the right data.
398
+
399
+ ## [0.7.6] — 2026-02-24
400
+
401
+ ### Added
402
+ - **`llms.txt` + `llms-full.txt`** Machine-readable project documentation for AI crawlers (2026 llms.txt standard). Helps Gemini, GPT, Claude, and other AI systems discover and understand Memorix automatically.
403
+ - **FAQ semantic anchors in README** 7 Q&A entries matching common AI search queries ("How do I keep context when switching IDEs?", "Is there an MCP server for persistent AI coding memory?", etc.)
404
+
405
+ ### Changed
406
+ - **GitHub repo description** Shortened to ~150 chars for optimal og:title/og:description generation
407
+ - **GitHub topics** — 20 GEO-optimized tags including `cursor-mcp`, `windsurf-mcp`, `claude-code-memory`, `cross-ide-sync`, `context-persistence`, `agent-memory`
408
+ - **package.json keywords** Replaced generic tags with IDE-specific MCP entity-linking keywords
409
+ - **package.json description** — Shortened to under 160 chars for better meta tag generation
410
+ - **MCP tool descriptions** — Enhanced `memorix_store`, `memorix_search`, `memorix_workspace_sync`, `memorix_skills` with cross-IDE context so AI search engines understand what problems they solve
411
+
412
+ ## [0.7.5] 2026-02-22
413
+
414
+ ### Changed
415
+ - **README rewrite** Completely restructured to focus on real-world scenarios, use cases, and features. Added 5 walkthrough scenarios, comparison table with alternatives, "Works with" badges for all 7 agents. Moved detailed config to sub-README.
416
+ - **New `docs/SETUP.md`** — Dedicated setup guide with agent-specific config, vector search setup, data storage, and troubleshooting
417
+
418
+ ## [0.7.4] 2026-02-22
419
+
420
+ ### Fixed
421
+ - **Hyphenated concepts not searchable** — Concepts like `project-detection` and `bug-fix` are now normalized to `project detection` and `bug fix` in the search index so Orama's tokenizer can split them into individual searchable terms. Original observation data is preserved unchanged.
422
+
423
+ ## [0.7.3] 2026-02-22
424
+
425
+ ### Fixed
426
+ - **Windows: git remote detection fails due to "dubious ownership"** — Added `safe.directory=*` flag to all git commands so MCP subprocess can read git info regardless of directory ownership settings. If git CLI still fails, falls back to directly parsing `.git/config` file. This fixes projects incorrectly getting `local/<dirname>` instead of `owner/repo` as their project ID.
427
+
428
+ ## [0.7.2] 2026-02-22
429
+
430
+ ### Fixed
431
+ - **`memorix_workspace_sync` rejects `kiro` as target** — Added `kiro` to `AGENT_TARGETS` enum (adapter was already implemented but missing from the tool's input schema)
432
+ - **`memorix_rules_sync` missing `kiro` target** Added `kiro` to `RULE_SOURCES` enum so Kiro steering rules can be generated as a sync target
433
+ - **VS Code Copilot README config** — Separated `.vscode/mcp.json` (workspace) and `settings.json` (global) formats which have different JSON structures
434
+
435
+ ## [0.7.1] — 2026-02-22
436
+
437
+ ### Fixed
438
+ - **Dashboard checkbox checkmark not visible** — Added `position: relative/absolute` to `.obs-checkbox::after` so the renders correctly in batch select mode
439
+ - **Embedding provider status flickers to "fulltext only"** — Replaced `initialized` boolean flag with a shared Promise lock; concurrent callers now wait for the same initialization instead of seeing `provider = null` mid-load
440
+ - **`memorix_dashboard` MCP tool reliability** — Replaced fixed 800ms wait with TCP port polling (up to 5s) so the tool only returns after the HTTP server is actually listening
441
+ - **Dashboard embedding status always shows "fulltext only"** — Fixed root cause: dashboard is an independent process, `isEmbeddingEnabled()` from orama-store always returns false there; now uses `provider !== null` directly
442
+
443
+ ## [0.7.0] 2026-02-21
444
+
445
+ ### Added
446
+ - **Memory-Driven Skills Engine** (`memorix_skills` MCP tool):
447
+ - `list` Discover all `SKILL.md` files across 7 agent directories
448
+ - `generate` Auto-generate project-specific skills from observation patterns (gotchas, decisions, how-it-works)
449
+ - `inject` — Return full skill content directly to agent context
450
+ - Intelligent scoring: requires skill-worthy observation types, not just volume
451
+ - Write to any target agent with `write: true, target: "<agent>"`
452
+ - **Transformers.js Embedding Provider**:
453
+ - Pure JavaScript fallback (`@huggingface/transformers`) no native deps required
454
+ - Provider chain: `fastembed``transformers.js` → fulltext-only
455
+ - Quantized model (`q8`) for small footprint
456
+ - **Dashboard Enhancements**:
457
+ - Canvas donut chart for observation type distribution
458
+ - Embedding provider status card (enabled/provider/dimensions)
459
+ - Search result highlighting with `<mark>` tags
460
+ - **17 new tests** for Skills Engine (list, generate, inject, write, scoring, dedup)
461
+
462
+ ### Changed
463
+ - Scoring algorithm requires at least 1 skill-worthy type (gotcha/decision/how-it-works/problem-solution/trade-off) — pure discovery/what-changed entities won't generate skills
464
+ - Volume bonus reduced from 2×obs to 1×obs (capped at 5) to favor quality over quantity
465
+ - Type diversity bonus increased from 2 to 3 points per unique skill-worthy type
466
+
467
+ ### Fixed
468
+ - 422 tests passing (up from 405), 34 test files, zero regressions
469
+
470
+ ## [0.5.0] — 2026-02-15
471
+
472
+ ### Added
473
+ - **Antigravity Adapter**: Full support for Antigravity/Gemini IDE (MCP config + rules)
474
+ - **Copilot Adapter**: VS Code Copilot MCP config adapter + rules format adapter
475
+ - **Comprehensive Documentation**: 7 developer docs in `docs/` (Architecture, Modules, API Reference, Design Decisions, Development Guide, Known Issues & Roadmap, AI Context)
476
+ - **8 new npm keywords**: antigravity, mcp-tool, memory-layer, ai-memory, progressive-disclosure, orama, vector-search, bm25
477
+ - `prepublishOnly` now runs `npm test` in addition to build
478
+
479
+ ### Changed
480
+ - README completely rewritten with clearer structure, npx zero-install setup, 6 agent configs, comparison table, Progressive Disclosure example, and architecture diagram
481
+ - `description` field expanded for better npm search ranking
482
+ - `files` array cleaned up (removed unused `examples` directory)
483
+
484
+ ### Fixed
485
+ - 274 tests passing (up from 219), zero regressions
486
+
487
+ ## [0.1.0] — 2026-02-14
488
+
489
+ ### Core
490
+ - Knowledge Graph: Entity-Relation-Observation model (MCP Official compatible)
491
+ - 3-Layer Progressive Disclosure: compact search → timeline → detail
492
+ - 9 observation types with icon classification
493
+ - Full-text search via Orama (BM25)
494
+ - Per-project isolation via Git remote detection
495
+ - 14 MCP tools (9 official + 5 Memorix extensions)
496
+
497
+ ### Cross-Agent Sync
498
+ - Rules Parser: 4 format adapters (Cursor, Claude Code, Codex, Windsurf)
499
+ - Rules Syncer: scan → deduplicate → conflict detection → cross-format generation
500
+ - Workspace Sync: MCP config migration + workflow sync + apply with backup/rollback
501
+
502
+ ### Intelligence (Competitor-Inspired)
503
+ - Access tracking: accessCount + lastAccessedAt (from mcp-memory-service)
504
+ - Token budget: maxTokens search trimming (from MemCP)
505
+ - Memory decay: exponential decay + retention lifecycle + immunity (from mcp-memory-service + MemCP)
506
+ - Entity extraction: regex-based file/module/URL/CamelCase extraction (from MemCP)
507
+ - Auto-enrichment: memorix_store auto-extracts and enriches concepts/files
508
+ - Causal detection: "because/due to/caused by" pattern detection
509
+ - Auto-relations: implicit Knowledge Graph relation creation (causes/fixes/modifies)
510
+ - Retention status: memorix_retention MCP tool
511
+
512
+ ### Vector Search
513
+ - Embedding provider abstraction layer (extensible)
514
+ - fastembed integration (optional, local ONNX, 384-dim bge-small)
515
+ - Orama hybrid search mode (BM25 + vector)
516
+ - Graceful degradation: no fastembed → fulltext only
517
+ - Embedding cache (5000 entries LRU)
518
+
519
+ ### Agent Instructions
520
+ - CLAUDE.md: Claude Code usage instructions + lifecycle hooks
521
+ - Example configs for Cursor, Windsurf, Codex