memorix 1.9.4 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/README.md +12 -6
  3. package/README.zh-CN.md +12 -6
  4. package/dist/cli/index.js +2533 -585
  5. package/dist/index.d.ts +15 -8
  6. package/dist/index.js +1201 -284
  7. package/dist/maintenance-runner.js +387 -216
  8. package/dist/media-audio-runner.js +300 -129
  9. package/dist/media-video-runner.js +300 -129
  10. package/dist/memcode-runtime/CHANGELOG.md +75 -1
  11. package/dist/sdk.d.ts +1 -0
  12. package/dist/sdk.js +1882 -998
  13. package/dist/types.d.ts +1 -1
  14. package/dist/vector-backfill-runner.js +300 -129
  15. package/docs/AGENT_OPERATOR_PLAYBOOK.md +47 -3
  16. package/docs/API_REFERENCE.md +39 -1
  17. package/docs/CONFIGURATION.md +58 -1
  18. package/docs/DEVELOPMENT.md +1 -1
  19. package/docs/DOCKER.md +23 -3
  20. package/docs/INTEGRATIONS.md +1 -1
  21. package/docs/KNOWN_ISSUES_AND_ROADMAP.md +61 -1
  22. package/docs/MULTI-DEVICE-SYNC-RESEARCH.md +4 -0
  23. package/docs/PERFORMANCE.md +46 -2
  24. package/docs/README.md +2 -1
  25. package/docs/SETUP.md +56 -1
  26. package/package.json +3 -2
  27. package/plugins/antigravity/memorix/plugin.json +1 -1
  28. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  29. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  30. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  31. package/plugins/copilot/memorix/plugin.json +1 -1
  32. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  33. package/plugins/hermes/memorix/plugin.yaml +1 -1
  34. package/plugins/omp/memorix/package.json +1 -1
  35. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  36. package/plugins/pi/memorix/package.json +1 -1
  37. package/server.json +2 -2
  38. package/src/cli/capability-map.ts +1 -0
  39. package/src/cli/command-guide.ts +15 -3
  40. package/src/cli/commands/agent-integrations.ts +57 -0
  41. package/src/cli/commands/background.ts +11 -2
  42. package/src/cli/commands/context.ts +2 -0
  43. package/src/cli/commands/continuity.ts +155 -0
  44. package/src/cli/commands/init.ts +5 -2
  45. package/src/cli/commands/serve-http.ts +435 -84
  46. package/src/cli/commands/setup.ts +77 -10
  47. package/src/cli/commands/sync-store.ts +47 -12
  48. package/src/cli/commands/sync.ts +26 -0
  49. package/src/cli/index.ts +3 -1
  50. package/src/cli/tui/ConfigureView.tsx +2 -0
  51. package/src/codegraph/auto-context.ts +17 -0
  52. package/src/config/legacy-loader.ts +2 -2
  53. package/src/config/resolved-config.ts +8 -5
  54. package/src/config/yaml-loader.ts +20 -10
  55. package/src/dashboard/server.ts +10 -12
  56. package/src/embedding/api-provider.ts +4 -2
  57. package/src/embedding/fastembed-provider.ts +47 -14
  58. package/src/embedding/transformers-provider.ts +29 -7
  59. package/src/evaluation/memory-quality-gate.ts +90 -0
  60. package/src/hooks/official-skills.ts +2 -0
  61. package/src/integrations/registry.ts +1 -1
  62. package/src/knowledge/context-assembly.ts +1 -0
  63. package/src/knowledge/context-receipt.ts +15 -0
  64. package/src/knowledge/task-continuity.ts +413 -0
  65. package/src/knowledge/workset.ts +77 -0
  66. package/src/llm/provider.ts +2 -1
  67. package/src/memory/graph.ts +10 -8
  68. package/src/memory/session.ts +1 -1
  69. package/src/orchestrate/coordinator.ts +60 -0
  70. package/src/orchestrate/effect-ledger.ts +160 -0
  71. package/src/orchestrate/pipeline-trace.ts +40 -6
  72. package/src/runtime/maintenance-jobs.ts +12 -6
  73. package/src/sdk.ts +24 -0
  74. package/src/server/mcp-binding-store.ts +14 -3
  75. package/src/server/modern-mcp-bridge.ts +153 -27
  76. package/src/server/tool-profile.ts +3 -2
  77. package/src/server.ts +131 -7
  78. package/src/store/file-lock.ts +28 -3
  79. package/src/store/graph-store.ts +178 -46
  80. package/src/store/persistence.ts +14 -9
  81. package/src/store/sqlite-db.ts +150 -7
  82. package/src/store/sqlite-store.ts +32 -27
  83. package/src/sync/engine.ts +9 -7
  84. package/src/sync/namespace.ts +23 -0
  85. package/src/sync/policy.ts +19 -4
  86. package/src/sync/store-port.ts +43 -13
  87. package/src/sync/types.ts +2 -0
  88. package/src/team/team-store.ts +62 -27
  89. package/src/types.ts +1 -1
  90. package/src/workspace/mcp-adapters/grok.ts +32 -0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,81 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [Unreleased]
5
+ ## Unreleased (1.9.x)
6
+
7
+ No unreleased changes.
8
+
9
+ ## [1.9.6] - 2026-09-22
10
+
11
+ ### Added
12
+ - **Task continuity ledger** -- adds a project-scoped append-only
13
+ ledger for requirements, decisions, verification, risks, and outcomes. The
14
+ bounded Project Context can include a ledger by `taskId`; no automatic
15
+ promotion or LLM summarization is performed.
16
+ - **Continuity outcome projection** -- adds deterministic validated, at-risk,
17
+ in-progress, and unverified states plus replay coverage. Diagnostic scores are
18
+ exposed in receipts only and do not silently reorder memories.
19
+ - **Infrastructure lifecycle closeout** -- bounds HTTP sessions and SQLite
20
+ handles, reuses project business runtimes behind fresh modern MCP protocol
21
+ shells, records event-loop/resource health, and adds a deterministic memory
22
+ quality gate.
23
+ - **Atlas Cloud memory preset** -- `memorix init` and the configuration TUI can
24
+ select Atlas Cloud for optional background memory LLM work through its
25
+ OpenAI-compatible endpoint, with provider-specific key isolation.
26
+
27
+ ### Fixed
28
+ - **Configuration scope isolation** -- explicit home/project resolution now
29
+ applies consistently to TOML, YAML, legacy JSON, and `.env` loading, so
30
+ long-lived processes and tests cannot reuse another configuration scope.
31
+ - **OrcaRouter documentation** -- documents the existing OpenAI-compatible
32
+ gateway path with fixed-model and fallback guidance; no vendor-specific
33
+ provider branch is required.
34
+ - **Capacity closeout** -- TeamStore queries, maintenance history, embedding
35
+ caches, HTTP project caches, and large-store behavior are bounded and
36
+ regression-covered.
37
+ - **Stable coordination queue order** -- available tasks now dispatch FIFO with
38
+ a SQLite rowid tie-breaker, preventing cross-platform adapter-routing flakes
39
+ when task timestamps collide.
40
+ - **Continuity correctness** -- verification obligations can move between
41
+ statuses by stable ID, retries are idempotent, open risks are visible in the
42
+ outcome state, and the 200-event cap is enforced transactionally.
43
+ - **Replay-safe orchestration evidence** -- tool effects are recorded with
44
+ redacted fingerprints, risk tiers, replay policy, and unknown-after-crash
45
+ status without persisting raw tool arguments or output.
46
+
47
+ ## [1.9.5] - 2026-09-20
48
+
49
+ ### Added
50
+ - **Setup HTTP MCP** -- `memorix setup --mcp http` honors Grok (writes a
51
+ `[mcp_servers.memorix]` URL in Grok `config.toml`) and rewrites installed
52
+ plugin/extension bundled MCP manifests from `memorix serve` to
53
+ `http://localhost:3211/mcp`. Default Grok MCP stays host-owned. Docs include
54
+ generic systemd user unit and LaunchAgent KeepAlive examples for
55
+ `memorix serve-http`.
56
+ - **User-global store sync** -- `memorix sync store push|pull|status --scope user`
57
+ replicates every local project's eligible observations through the existing
58
+ opt-in relay. Default `--scope project` is unchanged. Privacy filters still
59
+ drop personal, agent-targeted, candidate, and ephemeral rows. The live
60
+ SQLite file is never copied.
61
+
62
+ ### Fixed
63
+ - **HTTP control-plane safety** -- JSON request bodies are bounded, non-loopback
64
+ binds require an explicit Bearer token or unsafe opt-in, listen failures are
65
+ reported synchronously, background startup removes unverified state, and
66
+ shutdown waits for HTTP and SQLite resources to close.
67
+ - **Project-scoped graph storage** -- graph entities and relations now carry a
68
+ project key, legacy JSONL migration recovers ownership from observation
69
+ references, and Dashboard/MCP graph access no longer crosses projects.
70
+ - **Migration and lifecycle reliability** -- legacy observation/subdirectory
71
+ migrations use locks and atomic writes, malformed observation JSON fails
72
+ closed, stale file locks cannot evict a live writer, stateless MCP bindings
73
+ expire and are cleaned up, and SDK clients share resources safely.
74
+ - **User-scope sync correctness** -- imported observation IDs are remapped on
75
+ collision, tombstones validate their source project, and user namespaces
76
+ must be explicit per-user values.
77
+ - **Release contract** -- publish workflow validates tag/version/commit
78
+ identity, waits for npm visibility before MCP Registry publication, and
79
+ keeps prepublish checks non-mutating.
6
80
 
7
81
  ## [1.9.4] - 2026-09-18
8
82
 
package/README.md CHANGED
@@ -89,7 +89,7 @@ Memorix is more than a memory store. It also installs agent integrations, keeps
89
89
  | Orchestration and team work | Task planning, worker handoffs, file locks, messages, verification gates, and review loops | `memorix orchestrate`, `memorix team`, `memorix lock` |
90
90
  | memcode | A bundled terminal coding agent that already reads and writes the same project memory | `memorix`, `memcode` |
91
91
  | CLI and SDK | Scriptable access for automation, imports/exports, diagnostics, and custom integrations | `memorix ...`, `createMemoryClient()` |
92
- | Optional multi-device sync | Project-scoped, privacy-filtered observation events with local SQLite kept canonical; GitHub JSONL, filesystem, S3, or Postgres relay | `memorix sync store status\|push\|pull` |
92
+ | Optional multi-device sync | Privacy-filtered observation events with local SQLite kept canonical; default project scope, optional `--scope user` for every local project; GitHub JSONL, filesystem, S3, or Postgres relay | `memorix sync store status\|push\|pull` |
93
93
 
94
94
  <h2 id="works-with-your-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
95
95
 
@@ -225,9 +225,10 @@ CLI, MCP, and HTTP are different entry points:
225
225
 
226
226
  Multi-device store sync is opt-in and separate from HTTP sharing. It never
227
227
  uploads the live SQLite database or WAL files. By default it only relays
228
- qualified project-visible observations; personal, agent-targeted, candidate,
229
- ephemeral, and other-project records stay local. Set `MEMORIX_SYNC_PROVIDER` and
230
- inspect `memorix sync store status --json` before the first push.
228
+ qualified project-visible observations for the current Git project; personal,
229
+ agent-targeted, candidate, and ephemeral records stay local. Pass `--scope user`
230
+ to include every local project. Set `MEMORIX_SYNC_PROVIDER` and inspect
231
+ `memorix sync store status --json` before the first push.
231
232
 
232
233
  <h2 id="install"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="Install" height="32" /></picture></h2>
233
234
 
@@ -298,7 +299,7 @@ What it installs depends on the target agent, but the goal is the same: make Mem
298
299
  - Oh-my-Pi: installs an `omp.extensions` package with extension hook events, a `memorix` command, official skills, and writes MCP config.
299
300
  - DeepSeek Harness: writes a Memorix `@deepseek-ai/dsh-mcp-client` row into `$DSH_HOME/cordis.patch.yml` (default `~/.dsh/cordis.patch.yml`), appends guidance to the harness `AGENTS.md`, and installs official skills under `$DSH_HOME/skills`. The row follows DSH's own shipped Memorix reference, so tools appear as `mcp__memorix__*`.
300
301
  - WorkBuddy: writes a Memorix MCP server row into `~/.workbuddy/mcp.json` (or `<project>/.workbuddy/mcp.json` for project installs) and appends guidance to `AGENTS.md`. Tools appear as `mcp__memorix__*`; there is no hooks surface.
301
- - Grok Build: installs native lifecycle hooks under `~/.grok/hooks/memorix.json` and guidance in `~/.grok/AGENTS.md`. It leaves Grok's MCP configuration host-owned; project-local hooks require Grok `/hooks-trust`, while global hooks are trusted. Set `GROK_HOME` to use a custom Grok home.
302
+ - Grok Build: installs native lifecycle hooks under `~/.grok/hooks/memorix.json` and guidance in `~/.grok/AGENTS.md`. MCP stays host-owned by default; pass `--mcp http` to write `[mcp_servers.memorix]` with `url = "http://localhost:3211/mcp"`. Project-local hooks require Grok `/hooks-trust`, while global hooks are trusted. Set `GROK_HOME` to use a custom Grok home.
302
303
 
303
304
  Need a quieter install? Add `--noHooks` for targets where setup can control hook capture separately from the host's official package entry. It keeps MCP and guidance, but skips Memorix hook capture.
304
305
 
@@ -482,7 +483,7 @@ Long-term memory is deliberately not an automatic dump of every note. A source o
482
483
  | Use the bundled terminal agent | `memorix` or `memcode` |
483
484
  | Run orchestrated subagent work | `memorix orchestrate --goal "..."` |
484
485
 
485
- `memorix serve` defaults to `--mode micro` (9 tools) to keep MCP tool schemas small for agents. `memorix setup` writes `--mode lite` (20 tools) into the installed MCP config so the normal memory and session surface is reachable. Use `--mode team` (28 tools) for coordination tools, or `--mode full` (47 tools) for advanced and compatibility tools such as checkpoint inspection.
486
+ `memorix serve` defaults to `--mode micro` (9 tools) to keep MCP tool schemas small for agents. `memorix setup` writes `--mode lite` (21 tools) into the installed MCP config so the normal memory, continuity, and session surface is reachable. Use `--mode team` (29 tools) for coordination tools, or `--mode full` (48 tools) for advanced and compatibility tools such as checkpoint inspection.
486
487
 
487
488
  Shortcuts and aliases: `memorix search` / `remember` / `recent` are direct query shortcuts, `bg`/`bs` start the background service, `hook` runs the hook launcher, and `memorix config get|path|migrate` inspects or migrates config files.
488
489
 
@@ -525,6 +526,11 @@ formation = "active"
525
526
 
526
527
  Use `[memory.llm]` and `[embedding]` for Memorix memory quality and retrieval. Use `[agent]` for the model memcode talks to while coding. Keep credentials in global config or environment variables, and do not commit secrets.
527
528
 
529
+ For the optional Atlas Cloud memory preset, run `memorix init` and choose Atlas
530
+ Cloud, or set `provider = "atlascloud"` in `[memory.llm]`. It uses the
531
+ OpenAI-compatible `https://api.atlascloud.ai/v1` endpoint and reads
532
+ `ATLASCLOUD_API_KEY` or the explicit `MEMORIX_LLM_API_KEY`.
533
+
528
534
  For OpenRouter embeddings, use `provider = "api"`, `base_url = "https://openrouter.ai/api/v1"`, and `model = "qwen/qwen3-embedding-8b"`. Memorix accepts `OPENROUTER_API_KEY` for that embedding endpoint; `MEMORIX_EMBEDDING_API_KEY` remains the explicit override.
529
535
 
530
536
  For controlled MiniMax media generation, set `MINIMAX_API_KEY` (global) or
package/README.zh-CN.md CHANGED
@@ -84,7 +84,7 @@ Memorix 不只是一个记忆库。它还负责安装 Agent 接入、保留有
84
84
  | Orchestration 和团队协作 | 任务规划、worker 交接、文件锁、消息、验证门和 review loop | `memorix orchestrate`、`memorix team`、`memorix lock` |
85
85
  | memcode | 内置终端 Coding Agent,默认读写同一套项目记忆 | `memorix`、`memcode` |
86
86
  | CLI 和 SDK | 给自动化、导入导出、诊断和自定义集成使用的本地接口 | `memorix ...`、`createMemoryClient()` |
87
- | 可选多设备同步 | 按项目隔离、经过隐私过滤的记忆事件同步;本地 SQLite 仍是主库 | `memorix sync store status\|push\|pull` |
87
+ | 可选多设备同步 | 经过隐私过滤的记忆事件同步;本地 SQLite 仍是主库;默认按当前项目,可用 `--scope user` 覆盖全部本地项目 | `memorix sync store status\|push\|pull` |
88
88
 
89
89
  <h2 id="支持你的-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
90
90
 
@@ -219,9 +219,10 @@ CLI、MCP 和 HTTP 是不同入口:
219
219
  - `memorix background start` / `memorix serve-http` 是 HTTP 服务,用于共享端点、Dashboard、VPS Docker 部署或多客户端。
220
220
 
221
221
  多设备记忆同步是可选功能,和 HTTP 共享服务不是一回事。它不会上传
222
- `memorix.db`、WAL 或 SHM 文件。默认只同步当前项目中已确认且项目可见的
223
- 观察记录;个人、指定 Agent、候选、短期和其它项目的记录会留在本地。设置
224
- `MEMORIX_SYNC_PROVIDER` 后,先运行 `memorix sync store status --json` 再 push。
222
+ `memorix.db`、WAL 或 SHM 文件。默认只同步当前 Git 项目中已确认且项目可见的
223
+ 观察记录;个人、指定 Agent、候选和短期记录会留在本地。传入 `--scope user`
224
+ 可覆盖全部本地项目。设置 `MEMORIX_SYNC_PROVIDER` 后,先运行
225
+ `memorix sync store status --json` 再 push。
225
226
 
226
227
  <h2 id="安装"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="安装" height="32" /></picture></h2>
227
228
 
@@ -291,7 +292,7 @@ memorix setup --agent grok --global
291
292
  - CodeBuddy Code:安装用户级本地市场插件到 `~/.codebuddy/memorix-local`,包含 MCP、skills 和 hooks。它不会修改既有的 CodeBuddy 模型、权限或 settings 文件;第三方 hook 仍由 CodeBuddy 自己的 `/hooks` 流程确认。
292
293
  - Oh-my-Pi:安装 `omp.extensions` package,包含 extension hook 事件、`memorix` command、官方 skills,并写入 MCP 配置。
293
294
  - DeepSeek Harness:向 `$DSH_HOME/cordis.patch.yml`(默认 `~/.dsh/cordis.patch.yml`)写入一行 Memorix `@deepseek-ai/dsh-mcp-client`,向 harness 的 `AGENTS.md` 追加使用规范,并把官方 skills 安装到 `$DSH_HOME/skills`。这一行遵循 DSH 自带的 Memorix 参考配置,因此工具以 `mcp__memorix__*` 形式出现。
294
- - Grok Build:把原生生命周期 hooks 安装到 `~/.grok/hooks/memorix.json`,把使用规范写入 `~/.grok/AGENTS.md`。Grok 的 MCP 配置仍由 Grok 自己管理;项目级 hooks 需要在 Grok 中执行 `/hooks-trust`,全局 hooks 默认可信;也可以用 `GROK_HOME` 指定自定义 Grok 目录。
295
+ - Grok Build:把原生生命周期 hooks 安装到 `~/.grok/hooks/memorix.json`,把使用规范写入 `~/.grok/AGENTS.md`。默认仍由 Grok 自己管理 MCP;传入 `--mcp http` 时会写入 `[mcp_servers.memorix]`(`url = "http://localhost:3211/mcp"`)。项目级 hooks 需要在 Grok 中执行 `/hooks-trust`,全局 hooks 默认可信;也可以用 `GROK_HOME` 指定自定义 Grok 目录。
295
296
 
296
297
  如果你想要更安静一点的安装,可以对那些 setup 能独立控制 hook capture 的 target 加 `--noHooks`。它会保留 MCP 和使用规范,只跳过 Memorix 的 hook 自动捕获。
297
298
 
@@ -457,7 +458,7 @@ memcode
457
458
  | 使用内置终端 Agent | `memorix` 或 `memcode` |
458
459
  | 运行编排式 subagent 工作 | `memorix orchestrate --goal "..."` |
459
460
 
460
- `memorix serve` 默认使用 `--mode micro`(9 个工具),保持 MCP 工具 schema 紧凑。`memorix setup` 写入 `--mode lite`(20 个工具),覆盖常用记忆、会话、证据和反馈入口。需要协作工具时使用 `--mode team`(28 个工具),需要高级和兼容工具时使用 `--mode full`(47 个工具)。
461
+ `memorix serve` 默认使用 `--mode micro`(9 个工具),保持 MCP 工具 schema 紧凑。`memorix setup` 写入 `--mode lite`(21 个工具),覆盖常用记忆、连续性、会话、证据和反馈入口。需要协作工具时使用 `--mode team`(29 个工具),需要高级和兼容工具时使用 `--mode full`(48 个工具)。
461
462
 
462
463
  `memorix orchestrate` 单 worker 默认使用当前 checkout;多 worker 时会在 `.worktrees/` 下为任务创建隔离 worktree,并把成功的任务分支 merge 回来。用 `--isolated` 可强制单 worker 也隔离,用 `--no-worktree` 禁用 worktree,用 `--allow-dirty` 允许带未提交改动运行,用 `--no-auto-merge` 保留任务 worktree 方便人工 review。
463
464
 
@@ -498,6 +499,11 @@ formation = "active"
498
499
 
499
500
  `[memory.llm]` 和 `[embedding]` 负责记忆质量和检索;`[agent]` 是 memcode 编码时使用的模型。凭据放全局配置或环境变量,不要提交 secrets。
500
501
 
502
+ 如需使用可选的 Atlas Cloud 记忆模型预设,可以运行 `memorix init` 选择
503
+ Atlas Cloud,或在 `[memory.llm]` 中设置 `provider = "atlascloud"`。它使用
504
+ OpenAI-compatible 的 `https://api.atlascloud.ai/v1` endpoint,并读取
505
+ `ATLASCLOUD_API_KEY` 或显式的 `MEMORIX_LLM_API_KEY`。
506
+
501
507
  如果使用 OpenRouter embedding,可以设置 `provider = "api"`、`base_url = "https://openrouter.ai/api/v1"`、`model = "qwen/qwen3-embedding-8b"`。这个 endpoint 下 Memorix 会读取官方 `OPENROUTER_API_KEY`;需要单独覆盖 embedding key 时仍可用 `MEMORIX_EMBEDDING_API_KEY`。
502
508
 
503
509
  受控 MiniMax 媒体生成可在环境变量或 `.env` 中设置全局 `MINIMAX_API_KEY`,或中国区 `MINIMAX_CN_API_KEY`。媒体库不会保存该 key、临时签名 URL 或 base64 负载。CLI 生成本身就是显式操作;若要让 MCP 中的 Agent 发起生成,还必须明确设置 `MEMORIX_MCP_MEDIA_GENERATION=1`。