memorix 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +3 -3
  3. package/README.zh-CN.md +3 -3
  4. package/dist/cli/index.js +452 -109
  5. package/dist/index.js +376 -87
  6. package/dist/maintenance-runner.js +174 -41
  7. package/dist/media-audio-runner.js +174 -41
  8. package/dist/media-video-runner.js +174 -41
  9. package/dist/memcode-runtime/CHANGELOG.md +37 -0
  10. package/dist/sdk.js +375 -86
  11. package/dist/types.d.ts +2 -0
  12. package/dist/vector-backfill-runner.js +174 -41
  13. package/docs/1.2.4-PERSISTENT-MEMORY-DELIVERY.md +1 -1
  14. package/docs/API_REFERENCE.md +1 -1
  15. package/docs/DEVELOPMENT.md +5 -3
  16. package/package.json +1 -1
  17. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  18. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  19. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  20. package/plugins/copilot/memorix/plugin.json +1 -1
  21. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  22. package/plugins/omp/memorix/package.json +1 -1
  23. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  24. package/plugins/pi/memorix/package.json +1 -1
  25. package/server.json +2 -2
  26. package/src/cli/commands/codegraph.ts +48 -5
  27. package/src/cli/commands/context.ts +20 -4
  28. package/src/cli/commands/resume.ts +4 -0
  29. package/src/codegraph/auto-context.ts +4 -1
  30. package/src/codegraph/context-pack.ts +3 -1
  31. package/src/codegraph/external-provider.ts +93 -0
  32. package/src/embedding/api-provider.ts +105 -22
  33. package/src/embedding/provider.ts +2 -0
  34. package/src/hooks/installers/index.ts +1 -1
  35. package/src/hooks/official-skills.ts +3 -3
  36. package/src/hooks/rules/memorix-agent-rules.md +1 -1
  37. package/src/knowledge/context-receipt.ts +41 -0
  38. package/src/knowledge/workflows.ts +6 -3
  39. package/src/knowledge/workset.ts +56 -2
  40. package/src/llm/provider.ts +17 -8
  41. package/src/memory/formation/extract.ts +6 -3
  42. package/src/memory/formation/index.ts +2 -1
  43. package/src/memory/formation/resolve.ts +10 -6
  44. package/src/memory/formation/types.ts +3 -1
  45. package/src/memory/long-term.ts +7 -1
  46. package/src/server.ts +29 -13
  47. package/src/store/orama-store.ts +6 -4
  48. package/src/timeout.ts +67 -0
  49. package/src/types.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,43 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [1.6.0] - 2026-08-17
8
+
9
+ ### Added
10
+ - **Bounded context receipts** -- `memorix context|resume --brief-json`,
11
+ `memorix codegraph context-pack --brief-json`, and MCP project-context
12
+ `format: "receipt"` return only the agent-ready brief, selection receipt,
13
+ CodeGraph quality, and optional Agent loadout. The detailed `--json` and
14
+ MCP `format: "json"` forms remain available for diagnostics.
15
+ - **Task-scoped Agent loadouts** -- `--agent <target>` selects only compatible
16
+ project workflows and reports their required context and workflow tools.
17
+ This is guidance, not a replacement for the host agent's authorization.
18
+ - **Explicit external CodeGraph lifecycle** -- `memorix codegraph init|sync`
19
+ manages an already installed local CodeGraph index. It never invokes
20
+ CodeGraph's agent installer or writes Agent configuration.
21
+
22
+ ### Changed
23
+ - **Honest CodeGraph status** -- Status now distinguishes the persistent Lite
24
+ Code State index from the provider actually usable for the current task.
25
+ A stale external graph falls back to Lite instead of being presented as fresh.
26
+ - **Bounded fallback guidance** -- Newly generated Agent rules teach
27
+ `--brief-json` for the one CLI fallback; `--json` is reserved for deliberate
28
+ detailed diagnostics.
29
+
30
+ ## [1.5.1] - 2026-08-16
31
+
32
+ ### Fixed
33
+ - **Bounded formation cancellation** -- Formation deadlines now abort the
34
+ LLM and vector-search work they started, including response-body reads and
35
+ retry waits. A provider that ignores cancellation still cannot hold the
36
+ caller past its deadline.
37
+ - **Embedding error classification** -- Only an explicit HTTP 400 batch-shape
38
+ error may trigger batch splitting. Authentication, billing, quota, and
39
+ upstream errors fail once instead of multiplying latency through recursive
40
+ retries.
41
+
5
42
  ## [1.5.0] - 2026-08-14
6
43
 
7
44
  ### Added
package/README.md CHANGED
@@ -70,10 +70,10 @@ Memorix is more than a memory store. It also installs agent integrations, keeps
70
70
 
71
71
  | Capability | What it does | Entry point |
72
72
  | --- | --- | --- |
73
- | Memory Autopilot | A bounded task Workset with start files, current memory, source-backed knowledge, workflow starts, cautions, and verification | `memorix context "..."`, `memorix resume "..."`, `memorix_project_context` |
73
+ | Memory Autopilot | A bounded task Workset with start files, current memory, source-backed knowledge, workflow starts, cautions, and verification. Compact JSON receipts keep fallback CLI use bounded too. | `memorix context "..." --brief-json`, `memorix resume "..." --brief-json`, `memorix_project_context` |
74
74
  | Observation Memory | Searchable facts, fixes, gotchas, session summaries, and implementation notes scoped to the current Git project | `memorix memory`, MCP memory tools |
75
75
  | Curated Long-term Memory | Deliberately reviewed episodic, semantic, and procedural memory with source evidence. Only an explicitly portable user item can cross local projects | `memorix memory long-term` |
76
- | Code State and Code Memory | Versioned local code snapshots, file/symbol links, and freshness checks. The built-in Lite index is always honest about its limits; an already-indexed local CodeGraph can add a bounded semantic outline | `memorix codegraph`, automatic context refresh |
76
+ | Code State and Code Memory | Versioned local code snapshots, file/symbol links, and freshness checks. The built-in Lite index is always honest about its limits; an already-indexed local CodeGraph can add a bounded semantic outline and is only used when fresh. | `memorix codegraph status\|init\|sync`, automatic context refresh |
77
77
  | Git Memory | Commit-derived engineering facts that answer what changed, where, and why it matters | `memorix ingest commit`, git hook |
78
78
  | Reasoning Memory | Design rationale, alternatives, trade-offs, and risks that should survive beyond one chat | `memorix reasoning`, memory formation |
79
79
  | Knowledge Workspace | Review-gated source-backed claims, Markdown pages, and canonical project workflows; proposals never overwrite reviewed pages silently | `memorix knowledge`, `memorix knowledge workflow` |
@@ -437,7 +437,7 @@ Search is project-scoped by default. `scope="global"` searches across projects.
437
437
 
438
438
  Long-term memory is deliberately not an automatic dump of every note. A source observation, Claim, workflow, session, and code snapshot keep their existing roles. An agent may ask `memorix_store` to create an additional long-term record; an explicit request auto-qualifies and enters task briefs as a durable anchor, while hook-captured or Git-derived candidates stay pending until qualified. Approval stays an explicit operator review. Use `memorix memory long-term approve|archive|supersede` to record the evidence-backed lifecycle. Only a manually created or user-confirmed `user + portable` item may be considered in another local project; project code, Git facts, tests, workflows, sessions, and observations cannot be promoted into portable user memory.
439
439
 
440
- `memorix context "..."` is the default Memory Autopilot entry. It builds a compact task-lensed brief for agents: bugfix tasks lean toward tests and repros, release tasks lean toward package/changelog/build checks, onboarding tasks lean toward docs and entry points, and stale or unrelated memories stay in warning lanes instead of flooding the prompt. A normal new task does not receive an old-session dump. For an explicit continuation, `memorix resume "..."` adds only the latest useful session summary, up to three readable durable anchors, and at most one recent source-labelled host compact checkpoint. A durable anchor carries a `durable:<id>` reference, so an agent can expand the full reviewed record through `memorix_detail` only when needed. Keyword matches stay primary; when no reviewed durable item matches and an embedding provider is configured, Memorix makes one 1.8-second, no-retry semantic fallback for paraphrases or cross-language tasks. A slow or unavailable provider simply leaves the normal keyword-only Workset intact. A checkpoint is lifecycle evidence, not durable memory or a transcript backup. Agents should read the suggested files before trusting stored memory.
440
+ `memorix context "..."` is the default Memory Autopilot entry. It builds a compact task-lensed brief for agents: bugfix tasks lean toward tests and repros, release tasks lean toward package/changelog/build checks, onboarding tasks lean toward docs and entry points, and stale or unrelated memories stay in warning lanes instead of flooding the prompt. Use `--brief-json` when a CLI fallback needs the same bounded brief plus a receipt of what was selected or omitted; `--json` remains the detailed diagnostic form. A normal new task does not receive an old-session dump. For an explicit continuation, `memorix resume "..."` adds only the latest useful session summary, up to three readable durable anchors, and at most one recent source-labelled host compact checkpoint. A durable anchor carries a `durable:<id>` reference, so an agent can expand the full reviewed record through `memorix_detail` only when needed. Keyword matches stay primary; when no reviewed durable item matches and an embedding provider is configured, Memorix makes one 1.8-second, no-retry semantic fallback for paraphrases or cross-language tasks. A slow or unavailable provider simply leaves the normal keyword-only Workset intact. A checkpoint is lifecycle evidence, not durable memory or a transcript backup. Agents should read the suggested files before trusting stored memory.
441
441
 
442
442
  <h2 id="runtime-modes"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="Runtime Modes" height="32" /></picture></h2>
443
443
 
package/README.zh-CN.md CHANGED
@@ -69,10 +69,10 @@ Memorix 不只是一个记忆库。它还负责安装 Agent 接入、保留有
69
69
 
70
70
  | 能力 | 作用 | 入口 |
71
71
  | --- | --- | --- |
72
- | Memory Autopilot | 给新 Agent session 一份有预算的任务 Workset,包含起步文件、当前记忆、来源知识、工作流首步、风险提示和验证建议 | `memorix context "..."`、`memorix resume "..."`、`memorix_project_context` |
72
+ | Memory Autopilot | 给新 Agent session 一份有预算的任务 Workset,包含起步文件、当前记忆、来源知识、工作流首步、风险提示和验证建议。CLI 回退可用紧凑 JSON 回执,不再读取整套内部对象。 | `memorix context "..." --brief-json`、`memorix resume "..." --brief-json`、`memorix_project_context` |
73
73
  | Observation Memory | 当前 Git 项目内可检索的事实、修复、坑点、session 摘要和实现记录 | `memorix memory`、MCP memory tools |
74
74
  | 受管理的长期记忆 | 有来源证据、可审核的情景/语义/程序记忆;只有明确标为可携带的用户记忆才可在本机跨项目使用 | `memorix memory long-term` |
75
- | Code State 和 Code Memory | 可版本化的本地代码快照、文件 / symbol 关联和 freshness 检查。内置 Lite 会如实说明边界;已有本地索引的 CodeGraph 可额外给出有预算的语义关系 | `memorix codegraph`、自动 context refresh |
75
+ | Code State 和 Code Memory | 可版本化的本地代码快照、文件 / symbol 关联和 freshness 检查。内置 Lite 会如实说明边界;已有本地索引的 CodeGraph 可额外给出有预算的语义关系,但只有新鲜时才会用于任务。 | `memorix codegraph status\|init\|sync`、自动 context refresh |
76
76
  | Git Memory | 从 commit 中提取工程事实,回答改了什么、在哪里改、为什么重要 | `memorix ingest commit`、git hook |
77
77
  | Reasoning Memory | 保存设计原因、备选方案、trade-off 和风险,不让决策只留在一次聊天里 | `memorix reasoning`、memory formation |
78
78
  | Knowledge Workspace | 有审核门槛的来源证据 Claim、Markdown 知识页和规范化项目工作流;提案不会悄悄覆盖已审阅页面 | `memorix knowledge`、`memorix knowledge workflow` |
@@ -420,7 +420,7 @@ memcode
420
420
 
421
421
  长期记忆不是把所有笔记自动堆进去。Observation、Claim、工作流、session 和代码快照仍各自承担原来的职责。Agent 可以在 `memorix_store` 时要求额外生成长期记忆**候选**,但候选绝不会自动进入任务上下文;用 `memorix memory long-term qualify|approve|archive|supersede` 留下带证据的生命周期记录。只有人工创建或用户确认的 `user + portable` 记忆,才可能在同一台机器的其它项目中按任务相关性被使用;项目代码、Git 事实、测试、工作流、session 和 Observation 都不能被提升成可携带的用户记忆。
422
422
 
423
- `memorix context "..."` 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 `memorix resume "..."`,只会补入最近一份有用的会话总结、最多三条当前可读的长期记忆锚点,以及最多一条带来源标识的近期宿主压缩检查点。每个长期锚点都有 `durable:<id>` 引用,Agent 只在确实需要完整已审核记录时才通过 `memorix_detail` 展开。关键词仍优先;没有命中而且用户已配置 embedding 时,Memorix 才会做一次 1.8 秒、不重试的语义回退,用于模型改写或跨语言任务。服务变慢或不可用时,正常的关键词 Workset 会原样返回。检查点只是生命周期证据,不是长期记忆,也不是聊天记录备份。Agent 应该先读 suggested files,再相信历史记忆。
423
+ `memorix context "..."` 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。CLI 回退需要结构化结果时用 `--brief-json`,它只返回同一份有预算的 brief 和“选了什么、略了什么”的回执;`--json` 保留给详细诊断。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 `memorix resume "..."`,只会补入最近一份有用的会话总结、最多三条当前可读的长期记忆锚点,以及最多一条带来源标识的近期宿主压缩检查点。每个长期锚点都有 `durable:<id>` 引用,Agent 只在确实需要完整已审核记录时才通过 `memorix_detail` 展开。关键词仍优先;没有命中而且用户已配置 embedding 时,Memorix 才会做一次 1.8 秒、不重试的语义回退,用于模型改写或跨语言任务。服务变慢或不可用时,正常的关键词 Workset 会原样返回。检查点只是生命周期证据,不是长期记忆,也不是聊天记录备份。Agent 应该先读 suggested files,再相信历史记忆。
424
424
 
425
425
  <h2 id="运行模式"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="运行模式" height="32" /></picture></h2>
426
426