memorix 1.4.6 → 1.5.1

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 (119) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/TEAM.md +86 -86
  3. package/dist/cli/index.js +225 -70
  4. package/dist/cli/memcode.js +0 -0
  5. package/dist/index.js +225 -70
  6. package/dist/maintenance-runner.js +183 -38
  7. package/dist/media-audio-runner.js +183 -38
  8. package/dist/media-video-runner.js +183 -38
  9. package/dist/memcode-runtime/CHANGELOG.md +38 -0
  10. package/dist/sdk.js +224 -69
  11. package/dist/types.d.ts +2 -0
  12. package/dist/vector-backfill-runner.js +183 -38
  13. package/docs/CONFIGURATION.md +12 -0
  14. package/docs/DESIGN_DECISIONS.md +357 -357
  15. package/package.json +1 -1
  16. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  17. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  18. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  19. package/plugins/copilot/memorix/plugin.json +1 -1
  20. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  21. package/plugins/omp/memorix/package.json +1 -1
  22. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  23. package/plugins/pi/memorix/package.json +1 -1
  24. package/server.json +2 -2
  25. package/src/audit/index.ts +156 -156
  26. package/src/cli/commands/formation.ts +48 -48
  27. package/src/cli/commands/git-hook-install.ts +111 -111
  28. package/src/cli/commands/handoff.ts +54 -54
  29. package/src/cli/commands/hooks-status.ts +63 -63
  30. package/src/cli/commands/ingest.ts +44 -44
  31. package/src/cli/commands/integrate-shared.ts +15 -15
  32. package/src/cli/commands/lock.ts +82 -82
  33. package/src/cli/commands/message.ts +104 -104
  34. package/src/cli/commands/poll.ts +58 -58
  35. package/src/cli/commands/reasoning.ts +118 -118
  36. package/src/cli/commands/skills.ts +114 -114
  37. package/src/cli/commands/task.ts +167 -167
  38. package/src/cli/commands/transfer.ts +47 -47
  39. package/src/cli/index.ts +406 -406
  40. package/src/cli/tui/ChatView.tsx +234 -234
  41. package/src/cli/tui/CommandBar.tsx +312 -312
  42. package/src/cli/tui/ContextRail.tsx +118 -118
  43. package/src/cli/tui/HeaderBar.tsx +72 -72
  44. package/src/cli/tui/LogoBanner.tsx +51 -51
  45. package/src/cli/tui/index.ts +41 -41
  46. package/src/cli/version.ts +7 -7
  47. package/src/cli/workbench.ts +1 -1
  48. package/src/config.ts +23 -2
  49. package/src/dashboard/project-classification.ts +64 -64
  50. package/src/embedding/api-provider.ts +105 -22
  51. package/src/embedding/provider.ts +2 -0
  52. package/src/git/hooks-path.ts +85 -85
  53. package/src/hooks/pattern-detector.ts +173 -173
  54. package/src/hooks/significance-filter.ts +250 -250
  55. package/src/llm/memory-manager.ts +328 -328
  56. package/src/llm/provider.ts +17 -8
  57. package/src/llm/quality.ts +248 -248
  58. package/src/memory/attribution-guard.ts +249 -249
  59. package/src/memory/disclosure-policy.ts +135 -135
  60. package/src/memory/entity-extractor.ts +197 -197
  61. package/src/memory/formation/evaluate.ts +217 -217
  62. package/src/memory/formation/extract.ts +6 -3
  63. package/src/memory/formation/index.ts +2 -1
  64. package/src/memory/formation/resolve.ts +10 -6
  65. package/src/memory/formation/types.ts +3 -1
  66. package/src/memory/freshness.ts +122 -122
  67. package/src/memory/graph.ts +197 -197
  68. package/src/memory/long-term.ts +7 -1
  69. package/src/memory/refs.ts +94 -94
  70. package/src/memory/secret-filter.ts +79 -79
  71. package/src/orchestrate/adapters/claude-stream.ts +192 -192
  72. package/src/orchestrate/adapters/claude.ts +111 -111
  73. package/src/orchestrate/adapters/codex-stream.ts +134 -134
  74. package/src/orchestrate/adapters/codex.ts +41 -41
  75. package/src/orchestrate/adapters/gemini-stream.ts +166 -166
  76. package/src/orchestrate/adapters/gemini.ts +42 -42
  77. package/src/orchestrate/adapters/index.ts +73 -73
  78. package/src/orchestrate/adapters/opencode-stream.ts +143 -143
  79. package/src/orchestrate/adapters/opencode.ts +47 -47
  80. package/src/orchestrate/adapters/types.ts +77 -77
  81. package/src/orchestrate/capability-router.ts +284 -284
  82. package/src/orchestrate/cost-tracker.ts +219 -219
  83. package/src/orchestrate/error-recovery.ts +191 -191
  84. package/src/orchestrate/evidence.ts +140 -140
  85. package/src/orchestrate/ledger.ts +110 -110
  86. package/src/orchestrate/memorix-bridge.ts +343 -343
  87. package/src/orchestrate/output-budget.ts +80 -80
  88. package/src/orchestrate/permission.ts +152 -152
  89. package/src/orchestrate/pipeline-trace.ts +131 -131
  90. package/src/orchestrate/prompt-builder.ts +155 -155
  91. package/src/orchestrate/ring-buffer.ts +37 -37
  92. package/src/orchestrate/task-graph.ts +389 -389
  93. package/src/project/aliases.ts +374 -374
  94. package/src/rules/adapters/trae.ts +56 -56
  95. package/src/rules/syncer.ts +235 -235
  96. package/src/search/query-expansion.ts +52 -52
  97. package/src/server/formation-timeout.ts +27 -27
  98. package/src/server.ts +14 -10
  99. package/src/skills/mini-skills.ts +386 -386
  100. package/src/store/chat-store.ts +119 -119
  101. package/src/store/graph-store.ts +249 -249
  102. package/src/store/mini-skill-store.ts +349 -349
  103. package/src/store/orama-store.ts +6 -4
  104. package/src/store/persistence-json.ts +212 -212
  105. package/src/store/persistence.ts +291 -291
  106. package/src/store/project-affinity.ts +195 -195
  107. package/src/team/event-bus.ts +76 -76
  108. package/src/team/handoff.ts +161 -161
  109. package/src/team/poll.ts +132 -132
  110. package/src/timeout.ts +67 -0
  111. package/src/types.ts +2 -0
  112. package/src/workspace/mcp-adapters/codex.ts +191 -191
  113. package/src/workspace/mcp-adapters/copilot.ts +105 -105
  114. package/src/workspace/mcp-adapters/cursor.ts +53 -53
  115. package/src/workspace/mcp-adapters/kiro.ts +64 -64
  116. package/src/workspace/mcp-adapters/opencode.ts +123 -123
  117. package/src/workspace/mcp-adapters/trae.ts +134 -134
  118. package/src/workspace/mcp-adapters/windsurf.ts +91 -91
  119. package/src/workspace/sanitizer.ts +60 -60
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [1.5.1] - 2026-08-16
8
+
9
+ ### Fixed
10
+ - **Bounded formation cancellation** -- Formation deadlines now abort the
11
+ LLM and vector-search work they started, including response-body reads and
12
+ retry waits. A provider that ignores cancellation still cannot hold the
13
+ caller past its deadline.
14
+ - **Embedding error classification** -- Only an explicit HTTP 400 batch-shape
15
+ error may trigger batch splitting. Authentication, billing, quota, and
16
+ upstream errors fail once instead of multiplying latency through recursive
17
+ retries.
18
+
19
+ ## [1.5.0] - 2026-08-14
20
+
21
+ ### Added
22
+ - **Stability stress suite** -- Five deterministic, offline stress exams now
23
+ run in the normal test suite: a 2,000-observation corpus (planted needles,
24
+ ranked determinism, project isolation), 60-way parallel writes plus
25
+ 20-way same-topic upserts, session churn across projects with parallel
26
+ starts, 300-record long-term maintenance exactness, and repeated CLI
27
+ invocations. Live embedding stress exams are env-gated
28
+ (`MEMORIX_RUN_LIVE_EMBEDDING_TESTS=1`) and never run in CI.
29
+ - **Provider-aware embedding default** -- When the embedding base URL
30
+ points at OpenRouter and no model is configured, the default is now
31
+ `qwen/qwen3-embedding-8b` (4096 dimensions) instead of the OpenAI-only
32
+ default. An explicitly configured model always wins.
33
+
34
+ ### Changed
35
+ - **Verified OpenRouter embedding lane** -- The `api` embedding provider
36
+ was exercised live against `qwen/qwen3-embedding-8b` on OpenRouter:
37
+ a 100-text batch, cache round-trip, and provider-singleton stability all
38
+ pass. Docs cover the env-var form and borrowing `OPENROUTER_API_KEY`.
39
+ - **Multimodal vision option documented** -- Image analysis can run on the
40
+ LLM lane through an OpenAI-compatible vision endpoint, including
41
+ OpenRouter models such as `qwen/qwen3-vl-8b-instruct`.
42
+
5
43
  ## [1.4.6] - 2026-08-14
6
44
 
7
45
  ### Added
package/TEAM.md CHANGED
@@ -1,18 +1,18 @@
1
- # Memorix Team Protocol
2
-
1
+ # Memorix Team Protocol
2
+
3
3
  Rules for project-scoped autonomous-agent coordination via Memorix team tools. The Team page is an **Agent Team status surface** — it shows explicitly joined autonomous agents, open tasks, locks, messages, handoffs, and what needs attention. It is NOT an organization backend, staffing admin tool, or automatic chat room between separate IDE windows.
4
4
 
5
5
  Only agents that are intentionally participating in team/task/message/lock workflows need this protocol. Memory-only sessions should stay lightweight and do not need a team identity.
6
6
 
7
7
  For real autonomous multi-agent development, prefer `memorix orchestrate`: it launches and supervises CLI agent workers through Memorix tasks, context, verification, and fix loops. The team tools support that workflow; they should not be interpreted as proof that unrelated IDE conversation windows can autonomously contact each other.
8
-
9
- There are 4 team tools, each with an `action` parameter:
10
-
11
- - `team_manage` — action: join / leave / status
12
- - `team_file_lock` — action: lock / unlock / status
13
- - `team_task` — action: create / claim / complete / list
14
- - `team_message` — action: send / broadcast / inbox
15
-
8
+
9
+ There are 4 team tools, each with an `action` parameter:
10
+
11
+ - `team_manage` — action: join / leave / status
12
+ - `team_file_lock` — action: lock / unlock / status
13
+ - `team_task` — action: create / claim / complete / list
14
+ - `team_message` — action: send / broadcast / inbox
15
+
16
16
  ## RULE 1: Start Lightweight, Join Team Explicitly
17
17
 
18
18
  At the **beginning of every memory session**, before project-scoped memory work:
@@ -25,82 +25,82 @@ At the **beginning of every memory session**, before project-scoped memory work:
25
25
  4. Store the returned **agent ID** only after an explicit join — you will need it for subsequent team operations.
26
26
  5. Call `memorix_poll` with your agent ID to see current autonomous agents, check available tasks, and read unread messages.
27
27
  6. If you need a custom role or capabilities, use explicit `team_manage(join)` so the role overrides the default mapping cleanly.
28
-
29
- ## RULE 2: Lock Before Edit
30
-
31
- Before modifying any file that another agent might also be working on:
32
-
33
- 1. Call `team_file_lock` with `action: "status"` and the file path to check if it is already locked.
34
- 2. If unlocked, call `team_file_lock` with `action: "lock"`, the file path, and your agent ID.
35
- 3. If locked by another agent, **do not edit that file**. Either:
36
- - Work on a different file.
37
- - Send a `request` message to the lock owner asking them to release it.
38
- - Wait and re-check later.
39
- 4. When you are done editing, call `team_file_lock` with `action: "unlock"` to release the lock.
40
-
41
- **Never edit a file locked by another agent.** Lock violations cause merge conflicts and data loss.
42
-
43
- Locks auto-expire after 10 minutes. If you hold a lock for extended work, re-lock periodically to refresh the TTL.
44
-
45
- ## RULE 3: Use Tasks for Work Coordination
46
-
47
- When the user assigns work that involves multiple agents or multiple steps:
48
-
49
- 1. Call `team_task` with `action: "create"` to break the work into discrete tasks with clear descriptions.
50
- 2. Use `deps` to declare dependencies between tasks (a task cannot be claimed until its dependencies are completed).
51
- 3. Call `team_task` with `action: "claim"` to assign a task to yourself before starting work on it.
52
- 4. Call `team_task` with `action: "complete"` and a `result` summary when the task is done.
53
- 5. Call `team_task` with `action: "list"` to see overall progress and find available work.
54
-
55
- Rules:
56
- - Only claim tasks whose dependencies are all completed.
57
- - Only one agent may claim a given task.
58
- - If you cannot complete a claimed task, leave the team so the task returns to pending and another agent can pick it up.
59
-
60
- ## RULE 4: Communication Protocol
61
-
62
- Use `team_message` with `action: "send"` for direct messages and `action: "broadcast"` for announcements. Message types and their intended use:
63
-
64
- | Type | Use |
65
- |------|-----|
66
- | `request` | Ask another agent to do something, release a lock, or provide information. |
67
- | `response` | Reply to a prior request. |
68
- | `info` | Share context: discoveries, status updates, warnings about tricky code. |
69
- | `announcement` | Broadcast to all agents: major state changes, deployment events, breaking changes. |
70
- | `contract` | Propose or agree on a division of work. Both agents should acknowledge. |
71
- | `error` | Report a blocking issue that requires another agent's attention. |
72
-
73
- Rules:
74
- - `action: "send"` requires the full UUID of the target agent. Get it from `team_manage` with `action: "status"`.
75
- - Check your inbox (`action: "inbox"`) at least once before starting new work and once before ending a session.
76
- - Keep message content under 10KB. Be concise and actionable.
77
-
78
- ## RULE 5: Leave on Session End
79
-
80
- When the session is ending:
81
-
82
- 1. Call `team_file_lock` with `action: "unlock"` for every file you have locked, or they will remain locked until TTL expiry (10 min).
83
- 2. If you have in-progress tasks you cannot finish, leave them — leaving releases your tasks back to pending.
84
- 3. Call `team_manage` with `action: "leave"` and your agent ID. This marks you inactive, releases all your locks, and clears your inbox.
85
-
86
- ## RULE 6: Conflict Prevention
87
-
88
- - **Check before acting.** Always check team status and file lock status before starting work to understand the current state.
89
- - **Communicate before diverging.** If you plan to refactor shared code, broadcast an `announcement` first so other agents can save their work.
90
- - **Respect lock ownership.** The lock holder has exclusive write access. No exceptions.
91
- - **Prefer small, scoped changes.** Large cross-cutting changes increase conflict risk. Coordinate via tasks and messages if a change touches files other agents are working on.
92
- - **Do not duplicate work.** Check the task list before creating new tasks. If a similar task exists, claim it instead of creating a duplicate.
93
-
94
- ## Summary of Required Calls
95
-
96
- | When | Tool Call |
97
- |------|-----------|
28
+
29
+ ## RULE 2: Lock Before Edit
30
+
31
+ Before modifying any file that another agent might also be working on:
32
+
33
+ 1. Call `team_file_lock` with `action: "status"` and the file path to check if it is already locked.
34
+ 2. If unlocked, call `team_file_lock` with `action: "lock"`, the file path, and your agent ID.
35
+ 3. If locked by another agent, **do not edit that file**. Either:
36
+ - Work on a different file.
37
+ - Send a `request` message to the lock owner asking them to release it.
38
+ - Wait and re-check later.
39
+ 4. When you are done editing, call `team_file_lock` with `action: "unlock"` to release the lock.
40
+
41
+ **Never edit a file locked by another agent.** Lock violations cause merge conflicts and data loss.
42
+
43
+ Locks auto-expire after 10 minutes. If you hold a lock for extended work, re-lock periodically to refresh the TTL.
44
+
45
+ ## RULE 3: Use Tasks for Work Coordination
46
+
47
+ When the user assigns work that involves multiple agents or multiple steps:
48
+
49
+ 1. Call `team_task` with `action: "create"` to break the work into discrete tasks with clear descriptions.
50
+ 2. Use `deps` to declare dependencies between tasks (a task cannot be claimed until its dependencies are completed).
51
+ 3. Call `team_task` with `action: "claim"` to assign a task to yourself before starting work on it.
52
+ 4. Call `team_task` with `action: "complete"` and a `result` summary when the task is done.
53
+ 5. Call `team_task` with `action: "list"` to see overall progress and find available work.
54
+
55
+ Rules:
56
+ - Only claim tasks whose dependencies are all completed.
57
+ - Only one agent may claim a given task.
58
+ - If you cannot complete a claimed task, leave the team so the task returns to pending and another agent can pick it up.
59
+
60
+ ## RULE 4: Communication Protocol
61
+
62
+ Use `team_message` with `action: "send"` for direct messages and `action: "broadcast"` for announcements. Message types and their intended use:
63
+
64
+ | Type | Use |
65
+ |------|-----|
66
+ | `request` | Ask another agent to do something, release a lock, or provide information. |
67
+ | `response` | Reply to a prior request. |
68
+ | `info` | Share context: discoveries, status updates, warnings about tricky code. |
69
+ | `announcement` | Broadcast to all agents: major state changes, deployment events, breaking changes. |
70
+ | `contract` | Propose or agree on a division of work. Both agents should acknowledge. |
71
+ | `error` | Report a blocking issue that requires another agent's attention. |
72
+
73
+ Rules:
74
+ - `action: "send"` requires the full UUID of the target agent. Get it from `team_manage` with `action: "status"`.
75
+ - Check your inbox (`action: "inbox"`) at least once before starting new work and once before ending a session.
76
+ - Keep message content under 10KB. Be concise and actionable.
77
+
78
+ ## RULE 5: Leave on Session End
79
+
80
+ When the session is ending:
81
+
82
+ 1. Call `team_file_lock` with `action: "unlock"` for every file you have locked, or they will remain locked until TTL expiry (10 min).
83
+ 2. If you have in-progress tasks you cannot finish, leave them — leaving releases your tasks back to pending.
84
+ 3. Call `team_manage` with `action: "leave"` and your agent ID. This marks you inactive, releases all your locks, and clears your inbox.
85
+
86
+ ## RULE 6: Conflict Prevention
87
+
88
+ - **Check before acting.** Always check team status and file lock status before starting work to understand the current state.
89
+ - **Communicate before diverging.** If you plan to refactor shared code, broadcast an `announcement` first so other agents can save their work.
90
+ - **Respect lock ownership.** The lock holder has exclusive write access. No exceptions.
91
+ - **Prefer small, scoped changes.** Large cross-cutting changes increase conflict risk. Coordinate via tasks and messages if a change touches files other agents are working on.
92
+ - **Do not duplicate work.** Check the task list before creating new tasks. If a similar task exists, claim it instead of creating a duplicate.
93
+
94
+ ## Summary of Required Calls
95
+
96
+ | When | Tool Call |
97
+ |------|-----------|
98
98
  | Session start | `memorix_session_start` (lightweight) |
99
99
  | Join Agent Team | `memorix_session_start(joinTeam=true)` or `team_manage(join)` |
100
100
  | After joining | `memorix_poll` (check status + inbox) |
101
- | Before editing a shared file | `team_file_lock(status)`, `team_file_lock(lock)` |
102
- | After editing | `team_file_lock(unlock)` |
103
- | Starting a unit of work | `team_task(claim)` or `team_task(create)` + `team_task(claim)` |
104
- | Finishing a unit of work | `team_task(complete)` |
105
- | Need to coordinate | `team_message(send)` or `team_message(broadcast)` |
106
- | Session end | `team_file_lock(unlock)` (all), `team_manage(leave)` |
101
+ | Before editing a shared file | `team_file_lock(status)`, `team_file_lock(lock)` |
102
+ | After editing | `team_file_lock(unlock)` |
103
+ | Starting a unit of work | `team_task(claim)` or `team_task(create)` + `team_task(claim)` |
104
+ | Finishing a unit of work | `team_task(complete)` |
105
+ | Need to coordinate | `team_message(send)` or `team_message(broadcast)` |
106
+ | Session end | `team_file_lock(unlock)` (all), `team_manage(leave)` |