memorix 1.8.3 → 1.8.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/CLAUDE.md +3 -0
  3. package/README.md +4 -4
  4. package/README.zh-CN.md +5 -3
  5. package/dist/cli/index.js +1544 -635
  6. package/dist/dashboard/static/app.js +29 -885
  7. package/dist/dashboard/static/index.html +1 -5
  8. package/dist/dashboard/static/style.css +36 -503
  9. package/dist/index.d.ts +4 -4
  10. package/dist/index.js +214 -73
  11. package/dist/memcode/index.js +28035 -169
  12. package/dist/memcode-runtime/CHANGELOG.md +53 -0
  13. package/dist/sdk.js +30 -14
  14. package/docs/1.8.0-RELEASE-CANDIDATE-SPEC.md +22 -16
  15. package/docs/AGENT_OPERATOR_PLAYBOOK.md +2 -2
  16. package/docs/API_REFERENCE.md +10 -8
  17. package/docs/DASHBOARD.md +23 -0
  18. package/docs/DEVELOPMENT.md +2 -2
  19. package/docs/DOCKER.md +6 -3
  20. package/docs/INTEGRATIONS.md +1 -1
  21. package/docs/MODULES.md +46 -20
  22. package/docs/PERFORMANCE.md +1 -1
  23. package/docs/README.md +8 -7
  24. package/docs/SETUP.md +3 -3
  25. package/package.json +11 -11
  26. package/plugins/antigravity/memorix/plugin.json +1 -1
  27. package/plugins/antigravity/memorix/rules/memorix.md +5 -0
  28. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  29. package/plugins/claude/memorix/skills/memorix-memory/SKILL.md +3 -0
  30. package/plugins/claude/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  31. package/plugins/claude/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  32. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  33. package/plugins/codebuddy/memorix/skills/memorix-memory/SKILL.md +3 -0
  34. package/plugins/codebuddy/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  35. package/plugins/codebuddy/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  36. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  37. package/plugins/codex/memorix/skills/memorix-memory/SKILL.md +3 -0
  38. package/plugins/codex/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  39. package/plugins/codex/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  40. package/plugins/copilot/memorix/plugin.json +1 -1
  41. package/plugins/copilot/memorix/skills/memorix-memory/SKILL.md +3 -0
  42. package/plugins/copilot/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  43. package/plugins/copilot/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  44. package/plugins/cursor/memorix/skills/memorix-memory/SKILL.md +3 -0
  45. package/plugins/cursor/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  46. package/plugins/cursor/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  47. package/plugins/gemini/memorix/GEMINI.md +5 -0
  48. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  49. package/plugins/hermes/memorix/plugin.yaml +7 -1
  50. package/plugins/omp/memorix/package.json +1 -1
  51. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  52. package/plugins/pi/memorix/package.json +1 -1
  53. package/plugins/pi/memorix/skills/memorix-memory/SKILL.md +3 -0
  54. package/plugins/pi/memorix/skills/memorix-mini-skills/SKILL.md +2 -0
  55. package/plugins/pi/memorix/skills/memorix-orchestrate/SKILL.md +2 -0
  56. package/server.json +2 -2
  57. package/src/cli/command-guide.ts +52 -1
  58. package/src/cli/commands/background.ts +166 -6
  59. package/src/cli/commands/serve-http.ts +74 -86
  60. package/src/cli/commands/serve.ts +95 -93
  61. package/src/cli/index.ts +1 -1
  62. package/src/dashboard/static/index.html +1 -5
  63. package/src/dashboard/static/style.css +36 -503
  64. package/src/hooks/installers/index.ts +3 -0
  65. package/src/hooks/official-skills.ts +13 -6
  66. package/src/memory/graph.ts +2 -2
  67. package/src/server/mcp-diagnostics.ts +9 -7
  68. package/src/server/mcp-discovery.ts +0 -1
  69. package/src/server/modern-mcp-bridge.ts +108 -0
  70. package/src/server/stdio-startup-gate.ts +41 -2
  71. package/src/server/tool-profile.ts +7 -6
  72. package/src/server.ts +1 -1
  73. package/src/store/orama-store.ts +2 -2
  74. package/src/wiki/types.ts +2 -2
@@ -4,6 +4,59 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.8.5] - 2026-08-30
8
+
9
+ ### Fixed
10
+ - **Modern MCP transport** -- `memorix serve` and the HTTP control plane now
11
+ use the official MCP v2 server path for 2026-07-28 discovery, request
12
+ metadata, result envelopes, response metadata, stateless requests, and the
13
+ subscriptions listen surface while forwarding business tools through the
14
+ existing Memorix implementation.
15
+ - **Background start race (#259)** -- background startup now holds an
16
+ exclusive, heartbeating lock across the check/spawn/readiness window. Lock
17
+ contention fails closed with a retry message instead of starting an unlocked
18
+ duplicate control plane; stale dead-owner locks are recoverable.
19
+ - **Windows and EOF behavior** -- stdio discovery remains compatible before
20
+ and after readiness, roots-based project switching and deferred maintenance
21
+ are preserved, and stdin EOF closes the official transport cleanly.
22
+ - **Local build reliability** -- the large runtime, CLI, and memcode bundles
23
+ build sequentially, reducing Windows memory pressure without changing
24
+ published entry points. Slow CLI uninstall tests now use asynchronous,
25
+ hidden child processes so the full test run exits cleanly.
26
+ - **Time-stable graph evaluation** -- graph-context fixtures pin their
27
+ reference date so retention policy changes do not make the test depend on the
28
+ calendar.
29
+
30
+ ### MCP Compatibility Boundary
31
+ - Modern Tasks are explicitly unsupported because Memorix does not expose a
32
+ durable task store for MCP task semantics.
33
+ - List responses expose a private zero-TTL protocol hint; Memorix does not
34
+ claim a reusable server-side list cache.
35
+ - The external `@hasmcp/mcp-spec-test` runner currently fails on this Windows
36
+ host before reaching the target because it imports drive-letter paths as ESM
37
+ URLs. Production verification therefore includes official v2 direct tests,
38
+ real stdio/HTTP smoke, and the legacy compatibility path; this external
39
+ runner result is not reported as a pass.
40
+
41
+ ## [1.8.4] - 2026-08-27
42
+
43
+ ### Fixed
44
+ - **Stateless HTTP MCP requests (#255)** -- clients such as Claude Code that
45
+ send the current protocol header on every request can list and call tools
46
+ without echoing a custom project handle. Durable handles are still created
47
+ on `initialize` and remain available when a client opts into them.
48
+ - **MCP protocol self-description (#257)** -- discovery and HTTP response
49
+ headers now advertise the legacy revisions implemented by the pinned SDK,
50
+ instead of claiming complete support for the newer 2026 revision.
51
+ - **MCP stdio smoke contract** -- the release smoke script now checks the
52
+ truthful advertised revision set after the compatibility fix.
53
+
54
+ ### MCP Compatibility
55
+ - The 1.8.4 line supports legacy stateful MCP, versionless stdio tool calls,
56
+ pre-initialize discovery, and the narrow stateless HTTP compatibility path.
57
+ It does not claim full 2026 result metadata, Tasks, subscriptions, or list
58
+ caching support.
59
+
7
60
  ## [1.8.3] - 2026-08-25
8
61
 
9
62
  ### Fixed
package/dist/sdk.js CHANGED
@@ -162443,6 +162443,9 @@ var init_official_skills = __esm({
162443
162443
  '| Specific past decision, bug, file, or change | `memorix_search` | `memorix memory search --query "<topic>"` |',
162444
162444
  "| Need the full source for a search hit | `memorix_detail` | `memorix memory detail --id <id>` |",
162445
162445
  "| Need the sequence around one memory | `memorix_timeline` | `memorix memory timeline --id <id>` |",
162446
+ "| Check source and freshness for a memory | `memorix_evidence` | `memorix evidence list|get|events` |",
162447
+ "| Record whether a memory helped, conflicted, or was corrected | `memorix_feedback` | `memorix feedback record|show|audit` |",
162448
+ "| Inspect or import controlled media | `memorix_media` | `memorix media import|attach|list|show|status` |",
162446
162449
  '| Learned reusable project knowledge | `memorix_store` | `memorix memory store --type <type> --entity <name> --title "<title>" "<text>"` |',
162447
162450
  "| Task or bug is complete/outdated | `memorix_resolve` | `memorix memory resolve --ids <ids>` |",
162448
162451
  "",
@@ -162573,6 +162576,8 @@ var init_official_skills = __esm({
162573
162576
  "",
162574
162577
  "Promote memories into mini-skills only when they are reusable instructions, not just historical notes.",
162575
162578
  "",
162579
+ "The standard setup uses the `lite` MCP profile. `memorix_skills` and `memorix_promote` are full-profile tools, so use the CLI fallback unless the current server was explicitly started with `MEMORIX_MODE=full` or `--mode full`. Do not probe hidden MCP tools repeatedly.",
162580
+ "",
162576
162581
  "## Tool Router",
162577
162582
  "",
162578
162583
  "| Situation | Prefer | CLI fallback |",
@@ -162608,15 +162613,17 @@ var init_official_skills = __esm({
162608
162613
  "| Situation | Prefer | CLI fallback |",
162609
162614
  "|---|---|---|",
162610
162615
  '| Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` |',
162611
- "| Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` |",
162612
- "| Create or inspect tasks | `team_task` | `memorix task create|list|claim|complete` |",
162613
- "| Send or read coordination messages | `team_message` | `memorix message send|broadcast|inbox` |",
162614
- "| Share structured handoff | `memorix_handoff` | `memorix handoff send` |",
162615
- "| Avoid file conflicts | `team_file_lock` | `memorix lock lock|unlock|status` |",
162616
- "| Poll joined coordination state | `memorix_poll` | `memorix poll` |",
162616
+ "| Register coordination identity when team MCP tools are available | `team_manage` action `join` | `memorix team join --agentType <agent>` |",
162617
+ "| Create or inspect tasks when team MCP tools are available | `team_task` | `memorix task create|list|claim|complete` |",
162618
+ "| Send or read coordination messages when team MCP tools are available | `team_message` | `memorix message send|broadcast|inbox` |",
162619
+ "| Share structured handoff when team MCP tools are available | `memorix_handoff` | `memorix handoff send` |",
162620
+ "| Avoid file conflicts when team MCP tools are available | `team_file_lock` | `memorix lock lock|unlock|status` |",
162621
+ "| Poll joined coordination state when team MCP tools are available | `memorix_poll` | `memorix poll` |",
162617
162622
  "",
162618
162623
  "## Boundaries",
162619
162624
  "",
162625
+ "The standard setup uses the `lite` MCP profile. Coordination MCP tools are exposed only by `team` or `full`; use the CLI fallback for ordinary installations, or explicitly start the server with `--mode team`. Do not probe unavailable team tools in a loop.",
162626
+ "",
162620
162627
  "- For ordinary memory, do not join coordination state.",
162621
162628
  "- For production multi-agent execution, prefer `memorix orchestrate` so the main process owns planning, dispatch, retries, and verification gates.",
162622
162629
  "- `memorix orchestrate` uses the current checkout for single-worker runs and task worktrees for parallel runs. Use `--isolated` to force worktree isolation, `--no-worktree` to disable it, `--allow-dirty` to run with uncommitted changes, and `--no-auto-merge` to preserve task worktrees for manual review.",
@@ -163780,7 +163787,10 @@ alwaysApply: true
163780
163787
  "| `memorix_store` | Save something worth persisting |",
163781
163788
  '| `memorix_store_reasoning` | Save the "why" behind a decision |',
163782
163789
  "| `memorix_resolve` | Mark completed/outdated memories |",
163783
- "| `memorix_session_start` | Load session context (handoff, orchestration coordination) |"
163790
+ "| `memorix_session_start` | Load session context (handoff, orchestration coordination) |",
163791
+ "| `memorix_evidence` | Check a memory source, freshness, and verification state |",
163792
+ "| `memorix_feedback` | Record whether a memory helped, conflicted, or was corrected |",
163793
+ "| `memorix_media` | Inspect or import controlled local media |"
163784
163794
  ].join("\n");
163785
163795
  }
163786
163796
  async function uninstallHooks(agent, projectRoot, global2 = false) {
@@ -167662,16 +167672,24 @@ function resolveToolProfile(opts) {
167662
167672
  return normalize(opts.explicit) ?? normalize(opts.envValue) ?? opts.fallback;
167663
167673
  }
167664
167674
  function describeProfile(profile) {
167675
+ const count2 = countToolsInProfile(profile);
167665
167676
  switch (profile) {
167666
167677
  case "micro":
167667
- return "micro (agent-ready context + bounded recovery/media, ~9 tools)";
167678
+ return `micro (agent-ready context + bounded recovery/media, ${count2} tools)`;
167668
167679
  case "lite":
167669
- return "lite (core memory + sessions, ~18 tools)";
167680
+ return `lite (core memory + sessions, ${count2} tools)`;
167670
167681
  case "team":
167671
- return "team (lite + coordination tools + dashboard + knowledge workspace, ~26 tools)";
167682
+ return `team (lite + coordination tools + dashboard + knowledge workspace, ${count2} tools)`;
167672
167683
  case "full":
167673
- return "full (all tools including advanced / KG-compat)";
167684
+ return `full (all tools including advanced / KG-compat, ${count2} tools)`;
167685
+ }
167686
+ }
167687
+ function countToolsInProfile(profile) {
167688
+ let n = 0;
167689
+ for (const name of Object.keys(TOOL_PROFILES)) {
167690
+ if (isToolInProfile(name, profile)) n++;
167674
167691
  }
167692
+ return n;
167675
167693
  }
167676
167694
 
167677
167695
  // src/server.ts
@@ -167809,7 +167827,6 @@ import { z as z625 } from "zod/v4";
167809
167827
 
167810
167828
  // src/server/mcp-discovery.ts
167811
167829
  init_esm_shims();
167812
- var MCP_MODERN_PROTOCOL_VERSION = "2026-07-28";
167813
167830
  var MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";
167814
167831
  var MCP_OLDEST_LEGACY_PROTOCOL_VERSION = "2024-11-05";
167815
167832
  var MCP_SERVER_DISCOVER_METHOD = "server/discover";
@@ -167817,14 +167834,13 @@ var MCP_SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo";
167817
167834
  function getMcpServerInfo() {
167818
167835
  return {
167819
167836
  name: "memorix",
167820
- version: true ? "1.8.3" : "1.0.1"
167837
+ version: true ? "1.8.5" : "1.0.1"
167821
167838
  };
167822
167839
  }
167823
167840
  function createMcpDiscoverResult(capabilities, serverInfo) {
167824
167841
  return {
167825
167842
  resultType: "complete",
167826
167843
  supportedVersions: [
167827
- MCP_MODERN_PROTOCOL_VERSION,
167828
167844
  MCP_LEGACY_PROTOCOL_VERSION,
167829
167845
  MCP_OLDEST_LEGACY_PROTOCOL_VERSION
167830
167846
  ],
@@ -1,6 +1,9 @@
1
- # Memorix 1.8.0 Release Candidate Specification
1
+ # Memorix 1.8.5 Release Acceptance Specification
2
2
 
3
- Status: accepted implementation contract for Memorix 1.8.0.
3
+ Status: accepted implementation contract for Memorix 1.8.5.
4
+
5
+ This document keeps its historical filename for link stability. The current
6
+ release contract supersedes the original 1.8.0 wording below.
4
7
 
5
8
  ## Acceptance Checklist
6
9
 
@@ -14,22 +17,25 @@ Status: accepted implementation contract for Memorix 1.8.0.
14
17
  - [x] Provide dashboard evidence/provenance views without replacing the existing UI.
15
18
  - [x] Preserve explicit project/session handles across restart and client shapes.
16
19
  - [x] Verify CLI fallback, Windows child-process hiding, HTTP old/new smoke, build, and package contents.
20
+ - [x] Add the official MCP v2 transport path while retaining legacy clients.
21
+ - [x] Reject unsupported durable Tasks explicitly instead of returning fake success.
17
22
 
18
23
  ## Compatibility Contract
19
24
 
20
25
  Memorix preserves the legacy 2025-era initialize contract, including stdio and
21
- stateful Streamable HTTP with `Mcp-Session-Id`. Memorix 1.8.3 also registers a
22
- low-level `server/discover` compatibility adapter for the 2026-07-28 request.
23
- Its `DiscoverResult` is complete for the required identity, versions,
24
- capabilities, and private zero-TTL cache hint. Versionless `tools/list` and
25
- `tools/call` are accepted by the pinned v1 SDK and retain its legacy result
26
- envelopes. The stdio startup gate reads bounded newline-delimited input before
27
- project initialization, answers discovery immediately, and replays all other
28
- messages in order; EOF is deferred until the queued input is released. HTTP
29
- stateless project handles remain a compatibility adapter: they
30
- own project routing, but do not turn the v1 SDK into a complete 2026 runtime.
31
- Tasks, subscriptions, and list-response caching are unsupported and are not
32
- advertised or simulated.
26
+ stateful Streamable HTTP with `Mcp-Session-Id`. Memorix 1.8.5 uses the official
27
+ MCP v2 transport for the modern stateless path and retains the legacy bridge
28
+ for existing clients. The `server/discover` result is complete for the
29
+ supported identity, versions, capabilities, result metadata, and private
30
+ zero-TTL cache hint. Versionless `tools/list` and `tools/call` remain accepted
31
+ for legacy clients. The stdio startup gate reads bounded newline-delimited
32
+ input before project initialization, answers early discovery, and replays all
33
+ other messages in order; EOF is deferred until queued input is released.
34
+ Stateless HTTP project handles own project routing on the modern path.
35
+ Subscriptions are supported with the official listen surface. Durable Tasks
36
+ remain unsupported and are rejected explicitly because Memorix does not yet
37
+ have a durable MCP task contract; list responses carry a zero-TTL hint rather
38
+ than pretending to have a reusable server-side cache.
33
39
 
34
40
  Antigravity is the primary setup target. Gemini CLI remains a compatibility and
35
41
  migration path. GitHub issue #204 (WorkBuddy) is intentionally not merged or
@@ -73,8 +79,8 @@ is rejected for that task window.
73
79
 
74
80
  ## Explicit Non-goals for 1.8.0
75
81
 
76
- - No fake MCP Tasks/polling implementation when the pinned SDK does not expose
77
- a durable server-side task contract.
82
+ - No fake MCP Tasks/polling implementation when Memorix does not expose a
83
+ durable server-side task contract.
78
84
  - No remote memory hub, proxying of model traffic, or upstream installer.
79
85
  - No claim that the bundled Lite parser is a semantic CodeGraph.
80
86
  - No marketing landing page in place of an operator evidence console.
@@ -137,7 +137,7 @@ when the user wants:
137
137
  - explicit task/message/handoff/lock coordination
138
138
  - one shared HTTP service process
139
139
 
140
- Default recommendation: if the user wants memory inside an existing IDE or agent, start with `memorix setup --agent <agent> --global`. Use `memorix serve` only for manual MCP wiring. Use the CLI for direct workflows and automation because it does not depend on an IDE's MCP session lifecycle. Use memcode only when the user wants the bundled terminal agent. Reach for HTTP only when a shared background service, multi-client MCP access, Docker, or a live dashboard endpoint is actually needed.
140
+ Default recommendation: if the user wants memory inside an existing IDE or agent, start with `memorix setup --agent <agent> --global`. Use `memorix serve` only for manual MCP wiring. Use the CLI for direct workflows and automation because it does not depend on an IDE's MCP session lifecycle. Use memcode only when the user wants the bundled terminal agent. Reach for HTTP only when a shared background service, multi-client MCP access, a VPS Docker deployment, or a live dashboard endpoint is actually needed. Local development runs Node directly.
141
141
 
142
142
  Use:
143
143
 
@@ -826,7 +826,7 @@ read this document first, then act.
826
826
  This playbook is the canonical AI-facing guide for installation, project binding, integration, hooks, troubleshooting, and safe usage.
827
827
  ## Docker Note
828
828
 
829
- When Memorix runs in Docker, treat it as an **HTTP service deployment**, not a stdio MCP process.
829
+ When Memorix runs in Docker on a VPS/hosted machine, treat it as an **HTTP service deployment**, not a stdio MCP process. Docker is not required for local development.
830
830
 
831
831
  - Connect IDEs and agents to `http://host:3211/mcp`
832
832
  - Use `memorix_session_start(projectRoot=...)` with a path that is visible **inside** the container
@@ -28,7 +28,7 @@ Use **MCP** when:
28
28
  Use the **CLI** when:
29
29
 
30
30
  - you want to inspect or change project state from a terminal
31
- - you are on SSH / Docker / CI / NAS and want direct commands
31
+ - you are on SSH / VPS Docker / CI / NAS and want direct commands
32
32
  - you want readable, namespaced actions instead of raw MCP tool payloads
33
33
  - you want full access to Memorix CLI capabilities without depending on an MCP client
34
34
 
@@ -150,17 +150,19 @@ feedback projection.
150
150
  ### MCP Compatibility
151
151
 
152
152
  Legacy clients use stateful Streamable HTTP with `Mcp-Session-Id` and the
153
- 2025-era `initialize` handshake. The 1.8.3 stdio server starts a bounded
153
+ 2025-era `initialize` handshake. The 1.8.5 stdio server starts a bounded
154
154
  newline-delimited JSON-RPC gate before project initialization: it answers the
155
155
  2026-07-28 `server/discover` request before `initialize`, then replays other
156
156
  requests, notifications, and responses in order into the pinned SDK transport.
157
157
  Versionless `tools/list` and `tools/call` use the SDK's legacy result envelopes.
158
- HTTP stateless clients may use a durable
159
- `Mcp-Project-Handle`; `/protocol-diagnostics` labels this as compatibility-only.
160
- Modern result metadata is discovery-only with a private zero-TTL hint. Tasks,
161
- subscriptions, and list-response caching are unsupported. When MCP discovery
162
- is unavailable, use one bounded `memorix context --fallback` request for a
163
- task; repeated fallback probing is rejected by the local budget.
158
+ HTTP modern clients may use the stateless `2026-07-28` path and a durable
159
+ `Mcp-Project-Handle`; `/protocol-diagnostics` reports this as supported.
160
+ Modern result metadata is returned for discovery, list, and call responses.
161
+ The official subscriptions listen surface is available, but Memorix has no
162
+ durable Tasks implementation, so task requests remain explicitly unsupported.
163
+ List responses carry a private zero-TTL hint, not a reusable server-side cache.
164
+ When MCP discovery is unavailable, use one bounded `memorix context --fallback`
165
+ request for a task; repeated fallback probing is rejected by the local budget.
164
166
 
165
167
  The built-in Lite provider indexes common code files with lightweight file, symbol, and import facts. It is a structural fallback, not a language-server-quality graph. When a project already has a healthy local CodeGraph index, `[codegraph].external_context = "auto"` may add a validated, bounded semantic outline to the Workset. Memorix never initializes, syncs, or exports that external index, and never stores its raw source output. `memorix codegraph status --json`, `memorix doctor --json`, and Project Context JSON identify the actual provider quality.
166
168
 
package/docs/DASHBOARD.md CHANGED
@@ -7,6 +7,19 @@ used by MCP and CLI. It shows each card's source reference, locator, captured
7
7
  hash, freshness, verification state, and audit-event count. It is project
8
8
  scoped and does not replace the underlying observation or code source.
9
9
 
10
+ ## Surface Boundaries
11
+
12
+ Each Dashboard page maps to a real data surface: Overview shows overall state,
13
+ Git Memory shows Git-derived memory, Knowledge shows source-backed knowledge
14
+ pages, Memory Map shows the evidence-backed relation projection, Observations
15
+ and Evidence show records and provenance, Retention/Config/Identity show
16
+ runtime health, and Sessions/Coordination show session and persistent
17
+ coordination state.
18
+
19
+ These pages are not demo panels. Empty data is shown as empty, and failed reads
20
+ are shown as unavailable; the UI does not substitute another data model or old
21
+ graph renderer to make a result look healthy.
22
+
10
23
  ## Start
11
24
 
12
25
  ```bash
@@ -25,6 +38,16 @@ The Coordination Status page is a read-only projection of the selected project's
25
38
 
26
39
  The page reports agents, task status, file locks, and handoffs for the selected project. It exposes no team or task write endpoints and is not a task execution or full orchestration platform. If the SQLite read fails, the API returns an explicit degraded/error status and the page shows that the status is unavailable instead of presenting an empty result as healthy.
27
40
 
41
+ ## Memory Map
42
+
43
+ The Graph page is the single visual graph surface. It renders the deterministic,
44
+ source-backed `GET /api/knowledge-graph` projection with Apache ECharts. The
45
+ older Cytoscape/Dagre renderer is removed from the Dashboard, so an empty or
46
+ failed Memory Map no longer silently falls back to a different graph model.
47
+
48
+ `GET /api/graph` remains available as a backend compatibility route for MCP,
49
+ CLI, scripts, and older clients. It is not the Dashboard's visual data source.
50
+
28
51
  ## Maintenance Workbench
29
52
 
30
53
  The Observations page exposes three explicit maintenance actions:
@@ -13,8 +13,8 @@ Memorix is a TypeScript project built around:
13
13
 
14
14
  ## Current Development Baseline
15
15
 
16
- The current release work targets the **1.8.3 release line** and package metadata
17
- is kept at `1.8.3` for this release commit.
16
+ The current release work targets the **1.8.5 release line** and package metadata
17
+ is kept at `1.8.5` for this release commit.
18
18
 
19
19
  Contributors should assume the following areas are part of the current release line:
20
20
 
package/docs/DOCKER.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Docker Deployment
2
2
 
3
- Memorix supports Docker as an **HTTP service deployment path**.
3
+ Memorix supports Docker as a **VPS/hosted HTTP service deployment path**.
4
+
5
+ Local development and verification should run the Node service directly. Do
6
+ not start Docker Desktop or build a local image just to use Memorix.
4
7
 
5
8
  This Docker flow is for:
6
9
 
@@ -83,7 +86,7 @@ It is not a promise that stdio MCP magically becomes container-friendly.
83
86
 
84
87
  ## Important Path Truth
85
88
 
86
- Docker works best when Memorix can **see the repositories it is asked to bind**.
89
+ VPS Docker works best when Memorix can **see the repositories it is asked to bind**.
87
90
 
88
91
  Project-scoped features such as:
89
92
 
@@ -97,7 +100,7 @@ depend on the HTTP service being able to access the repository path.
97
100
 
98
101
  ### Good fit
99
102
 
100
- - Docker Desktop on the same machine as your IDE
103
+ - a VPS or hosted machine that can see the repositories it is asked to bind
101
104
  - a compose setup that mounts the repo you are working on into the container
102
105
  - `memorix_session_start(projectRoot=...)` using a path visible **inside** the container
103
106
 
@@ -26,7 +26,7 @@ That command installs the recommended Memorix package or config for the target a
26
26
  | memcode | Opens a terminal coding agent that already uses Memorix memory | `memorix`, `memcode` |
27
27
  | HTTP service | Runs one shared MCP endpoint plus dashboard | `memorix background start` |
28
28
 
29
- HTTP is not required for normal agent setup. Use it when you intentionally want a shared background process, dashboard, Docker deployment, or multiple clients using the same MCP endpoint.
29
+ HTTP is not required for normal agent setup. Use it when you intentionally want a shared background process, dashboard, VPS Docker deployment, or multiple clients using the same MCP endpoint. Local verification runs the Node service directly; Docker is not required on a developer machine.
30
30
 
31
31
  CLI, MCP, and HTTP have separate jobs:
32
32
 
package/docs/MODULES.md CHANGED
@@ -1,18 +1,35 @@
1
1
  # Memorix 模块详解
2
2
 
3
- > 最后更新: 2026-08-14 (v1.4.3)
4
- > 本文档详细记录每个模块的实现细节、关键算法和注意事项
3
+ > 最后更新: 2026-08-30(当前发布线 v1.8.5)
4
+ > 本文档记录当前模块边界、关键算法和兼容层,不把历史实现误写成运行时主路径。
5
5
 
6
- > 本文档中的早期 JSON/Orama 章节保留为历史模块说明。当前运行时的
7
- > SQLite 数据层和长期记忆生命周期以 `docs/ARCHITECTURE.md`、
8
- > `docs/1.3-MEMORY-ARCHITECTURE.md` 及对应源码为准。
6
+ > 当前真实主路径先看下面的模块总览,再看各模块的细节。早期 JSON/Orama
7
+ > 说明仍保留用于迁移和实现背景,但不代表 JSON 是运行时主存储。
8
+
9
+ ## 当前模块总览
10
+
11
+ | 模块 | 当前作用 | 是否主路径 |
12
+ | --- | --- | --- |
13
+ | `store/sqlite-db.ts`、`store/sqlite-store.ts` | 持久化观察、会话、图谱、知识、长期记忆、媒体和协作状态 | 是 |
14
+ | `store/orama-store.ts` | 从 SQLite 数据重建的全文/向量检索索引 | 是,索引层 |
15
+ | `memory/graph.ts` | MCP 兼容的实体/关系操作外观,底层写入 SQLite | 是 |
16
+ | `wiki/knowledge-graph.ts` | Dashboard 的证据化 Memory Map 投影,不是真实数据源 | 是,展示层 |
17
+ | `dashboard/static/` | 只保留 ECharts Memory Map 这一套图谱界面 | 是 |
18
+ | `dashboard/server.ts`、`cli/commands/serve-http.ts` | 独立 Dashboard 与 HTTP 控制面两个宿主;按各自绑定范围读取同一套业务模块 | 是,宿主层 |
19
+ | `store/persistence-json.ts`、`config/legacy-loader.ts` | 老版本数据和配置的迁移/兼容读取 | 兼容层 |
20
+
21
+ 本轮清扫移除了 Dashboard 旧的 Cytoscape/Dagre 图谱渲染器及其前端依赖。
22
+ 后端 `/api/graph` 和 MCP 图谱工具仍保留,因为外部脚本和客户端可能直接调用它们。
23
+ 两个 Dashboard 宿主也保留:standalone 用于本地只读浏览,HTTP 控制面负责带会话和
24
+ 项目绑定的服务。它们可以共享维护逻辑,但不能因为代码位置相似就把绑定边界合并。
9
25
 
10
26
  ---
11
27
 
12
- ## 1. Orama 搜索引擎 (`store/orama-store.ts`)
28
+ ## 1. Orama 搜索索引 (`store/orama-store.ts`)
13
29
 
14
30
  ### 概述
15
- 基于 [Orama](https://github.com/orama/orama) 的全文/混合搜索引擎,344行。
31
+ 基于 [Orama](https://github.com/orama/orama) 的全文/混合搜索索引。它不是持久化主库;
32
+ 启动或数据变化后可从 SQLite 观察记录重建。
16
33
 
17
34
  ### Schema 设计
18
35
  ```typescript
@@ -51,14 +68,22 @@ const schema = {
51
68
 
52
69
  ### ⚠️ 注意事项
53
70
  - Orama 的 where 子句在 `term: '' + number filter` 时可能不可靠,因此 `compactDetail` 使用内存查找而非 Orama 查询
54
- - 数据库是内存中的,重启后需要通过 `reindexObservations()` 重建
71
+ - 索引是内存中的,重启后需要通过 `reindexObservations()` 从 SQLite 重建
55
72
  - `resetDb()` 用于热重载场景 — 先清空再重建
56
73
 
57
74
  ---
58
75
 
59
- ## 2. 持久化层 (`store/persistence.ts`)
76
+ ## 2. 持久化层 (`store/sqlite-db.ts`, `store/sqlite-store.ts`, `store/persistence.ts`)
77
+
78
+ ### 当前主路径
79
+
80
+ 运行时使用 `~/.memorix/data/memorix.db` 这一 SQLite 数据库。观察记录、图谱、知识
81
+ 工作区、长期记忆、媒体、会话和协作状态共享同一数据库连接与迁移机制;`projectId`
82
+ 用于数据隔离,不再通过多个 JSON 子目录拼接运行时状态。
83
+
84
+ ### 历史 JSON/JSONL 兼容格式
60
85
 
61
- ### 存储目录
86
+ 以下文件只用于旧版本迁移、显式导入导出或诊断,不是新写入的主路径。
62
87
  ```
63
88
  ~/.memorix/data/
64
89
  ├── observations.json # 所有 observation 的 JSON 数组
@@ -76,16 +101,16 @@ const schema = {
76
101
  {"name":"port-config","entityType":"config","observations":["默认端口 3001"]}
77
102
  ```
78
103
 
79
- ### 设计决策
80
- - **全局共享目录** (`~/.memorix/data/`): 让不同 Agent 看到同一份数据
81
- - **JSONL 而非单 JSON**: 与 MCP Official Memory Server 的格式兼容
82
- - **observations.json 用 JSON 而非 JSONL**: observation 结构更复杂,JSON 更方便整体读写
83
- - **ID 计数器单独文件**: 避免扫描所有 observation 来确定下一个 ID
104
+ ### 兼容设计
105
+ - **全局共享目录** (`~/.memorix/data/`): 让不同 Agent 看到同一份 SQLite 数据
106
+ - **JSONL**: 保留 MCP Official Memory Server 兼容和旧数据迁移能力
107
+ - **observations.json**: 保留旧 observation 导入和显式导出能力
108
+ - **SQLite 事务与文件锁**: 新写入由 SQLite 事务负责一致性,必要时仍使用文件锁保护跨进程操作
84
109
 
85
110
  ### ⚠️ 注意事项
86
- - v0.9.6 后所有数据存储在单一平坦目录 `~/.memorix/data/`,projectId 仅作为元数据
87
- - 有文件锁机制 (`store/file-lock.ts`) — 使用 `.memorix.lock` 目录锁 + 10s 超时检测
88
- - 热重载使用 `fs.watchFile` (polling) 监听 `observations.json` 变化
111
+ - `store/persistence-json.ts` 是兼容模块,不要把它当成新的写入 API
112
+ - `migrateSubdirsToFlat()` 只处理早期按项目分目录的数据
113
+ - `store/obs-store.ts` 在 SQLite 不可用时会进入只读降级模式,不应偷偷回写 `observations.json`
89
114
 
90
115
  ---
91
116
 
@@ -105,12 +130,13 @@ const schema = {
105
130
  | `readGraph` | 返回完整图谱 |
106
131
 
107
132
  ### 持久化时机
108
- - 每次 CRUD 操作后立即写入磁盘
109
- - `init()` 时从磁盘加载
133
+ - 每次 CRUD 操作后立即写入共享 SQLite 数据库
134
+ - `init()` 时从 SQLite 加载
110
135
 
111
136
  ### ⚠️ 注意事项
112
137
  - `createEntities` 对同名实体是幂等的 — 不会覆盖已有观察
113
138
  - 关系的 `from` 和 `to` 必须引用已存在的实体名
139
+ - JSONL 只属于兼容输入/输出;当前实体和关系由 SQLite `graph_entities`、`graph_relations` 表提供
114
140
 
115
141
  ---
116
142
 
@@ -57,7 +57,7 @@ On the release development machine used for this check, the healthy HTTP service
57
57
 
58
58
  ## What Can Be Heavier
59
59
 
60
- - `npm run build`, `npx vitest run`, and Docker image builds can use substantial CPU and disk while they run.
60
+ - `npm run build` and `npx vitest run` can use substantial CPU and disk while they run. Local verification uses the sequential Node/npm build and does not require Docker; Docker image builds are reserved for the VPS/hosted deployment path.
61
61
  - Docker image size mostly comes from Node, npm dependencies, build artifacts, and image layers. The container runtime should be judged separately from image size.
62
62
  - Dashboard browsing can add browser-side memory and CPU outside the Memorix Node process.
63
63
  - Large imports, Git log ingestion, workspace sync, and skill generation can temporarily increase CPU and disk I/O.
package/docs/README.md CHANGED
@@ -79,6 +79,7 @@ The public docs are organized by user intent:
79
79
  | System shape, data flows, memory layers | [ARCHITECTURE.md](ARCHITECTURE.md) |
80
80
  | Design decisions and rationale | [DESIGN_DECISIONS.md](DESIGN_DECISIONS.md) |
81
81
  | Module-by-module notes | [MODULES.md](MODULES.md) |
82
+ | Current implementation status and ecosystem watch | [ACTIVE_WORK.md](../ACTIVE_WORK.md) |
82
83
  | CodeGraph Memory / Context Fabric design | [2026-06-29-codegraph-memory-context-fabric-design.md](superpowers/specs/2026-06-29-codegraph-memory-context-fabric-design.md) |
83
84
  | Auto Context Layer design | [2026-06-29-auto-context-layer-design.md](superpowers/specs/2026-06-29-auto-context-layer-design.md) |
84
85
  | 1.2 product direction and user journey | [1.2 Product Story](1.2.0-PRODUCT-STORY.md) |
@@ -94,7 +95,7 @@ The public docs are organized by user intent:
94
95
  | 1.2 honest Lite and optional semantic CodeGraph provider contract | [1.2 Provider Quality](1.2.0-PROVIDER-QUALITY.md) |
95
96
  | 1.3 long-term memory model, source boundary, and lifecycle | [1.3 Memory Architecture](1.3-MEMORY-ARCHITECTURE.md) |
96
97
  | Active context-control work | [1.2.2 Memory Control Plane](1.2.2-MEMORY-CONTROL-PLANE.md) |
97
- | 1.8.3 stdio discovery startup and compatibility acceptance contract | [1.8.0 Release Specification](1.8.0-RELEASE-CANDIDATE-SPEC.md) |
98
+ | 1.8.5 MCP compatibility acceptance contract | [1.8.0 Release Specification](1.8.0-RELEASE-CANDIDATE-SPEC.md) |
98
99
  | Historical cloud sync and multi-agent research | [CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md](CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md) |
99
100
  | Known issues and old roadmap notes | [KNOWN_ISSUES_AND_ROADMAP.md](KNOWN_ISSUES_AND_ROADMAP.md) |
100
101
 
@@ -122,7 +123,7 @@ Historical/deep-reference documents may describe older designs. If they conflict
122
123
 
123
124
  ## Current Product Line
124
125
 
125
- The current product line is **1.8.3**. The authoritative acceptance contract is
126
+ The current product line is **1.8.5**. The authoritative acceptance contract is
126
127
  [1.8.0 Release Specification](1.8.0-RELEASE-CANDIDATE-SPEC.md).
127
128
  The current baseline has:
128
129
 
@@ -141,13 +142,13 @@ The current baseline has:
141
142
  - `~/.memorix/config.toml` and project `memorix.toml` are the user-facing configuration model
142
143
  - legacy `memorix.yml`, `.env`, and `config.json` files are still read for compatibility, but new setups should use TOML
143
144
 
144
- For MCP compatibility, 1.8.3 preserves legacy 2025-era initialize and
145
+ For MCP compatibility, 1.8.5 preserves legacy 2025-era initialize and
145
146
  stateful Streamable HTTP behavior. `memorix serve` starts a bounded stdio
146
147
  startup gate: pre-initialize 2026-07-28 `server/discover` is answered with a
147
148
  complete discovery result, and other early JSON-RPC messages replay in order
148
149
  through the pinned SDK transport. Versionless `tools/list` and `tools/call`
149
150
  continue through the SDK's legacy result envelopes. Modern result metadata is
150
- limited to the discovery response (`ttlMs: 0`, private cache scope); Tasks,
151
- subscriptions, and list-response caching are unsupported. Stateless HTTP
152
- project handles are a compatibility adapter, not a claim of complete 2026
153
- conformance.
151
+ returned for discovery, list, and call responses. The official subscriptions
152
+ listen surface is available. Durable Tasks remain explicitly unsupported, and
153
+ list responses carry a private zero-TTL hint instead of a reusable server-side
154
+ cache. Stateless HTTP project handles are supported on the modern path.
package/docs/SETUP.md CHANGED
@@ -24,7 +24,7 @@ Common runtime entry points:
24
24
  | `memorix serve-http --port 3211` | foreground HTTP MCP for debugging or supervised launches |
25
25
  | `memorix` / `memcode` | bundled terminal agent that uses the same Memorix memory pool |
26
26
 
27
- Most users should start with `memorix setup --agent <agent> --global`. Use raw `memorix serve` only when you are wiring an MCP client manually. Use HTTP when you intentionally want one shared background process, browser dashboard, Docker deployment, or multiple clients using the same MCP endpoint. Use the CLI for manual operation and automation. Use memcode when you want the bundled terminal agent.
27
+ Most users should start with `memorix setup --agent <agent> --global`. Use raw `memorix serve` only when you are wiring an MCP client manually. Use HTTP when you intentionally want one shared background process, browser dashboard, VPS Docker deployment, or multiple clients using the same MCP endpoint. Local development and verification run the Node service directly and do not require Docker. Use the CLI for manual operation and automation. Use memcode when you want the bundled terminal agent.
28
28
 
29
29
  For agent-specific plugin, rules, hooks, and skills support, see [INTEGRATIONS.md](INTEGRATIONS.md).
30
30
 
@@ -151,7 +151,7 @@ memorix serve
151
151
 
152
152
  Use this when your agent only needs a raw local stdio MCP process or you are debugging a manual config. The agent starts `memorix serve` and communicates with it over stdio.
153
153
 
154
- A bare `memorix serve` defaults to `--mode micro`, which exposes 9 high-signal tools so agent context is not crowded by rarely used schemas. Use `memorix serve --mode lite` for the extended solo memory surface, `--mode team` for coordination tools, or `--mode full` for advanced and MCP Memory compatibility tools.
154
+ A bare `memorix serve` defaults to `--mode micro`, which exposes 9 high-signal tools so agent context is not crowded by rarely used schemas. Use `memorix serve --mode lite` for the 20-tool solo memory surface, `--mode team` for the 28-tool coordination surface, or `--mode full` for all 47 advanced and MCP Memory compatibility tools.
155
155
 
156
156
  `memorix setup` writes `--mode lite` into the installed MCP config: the generated guidance teaches the extended surface (sessions, timeline, reasoning, retention), so the installed server must actually expose it. Override with `MEMORIX_MODE` if you prefer a different profile.
157
157
 
@@ -216,7 +216,7 @@ This starts a local background service:
216
216
  - MCP endpoint: `http://localhost:3211/mcp`
217
217
  - health: `http://localhost:3211/health`
218
218
 
219
- HTTP mode is for a shared process. It is useful when multiple clients should connect to one Memorix endpoint, when you want the browser dashboard, or when running Memorix through Docker. It is not needed for the normal one-agent stdio MCP setup.
219
+ HTTP mode is for a shared process. It is useful when multiple clients should connect to one Memorix endpoint, when you want the browser dashboard, or when running Memorix through Docker on a VPS/hosted machine. It is not needed for the normal one-agent stdio MCP setup.
220
220
 
221
221
  Companion commands:
222
222