memorix 1.2.6 → 1.2.7

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 (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +6 -3
  3. package/README.zh-CN.md +5 -2
  4. package/dist/cli/index.js +954 -72
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/memcode.js +0 -0
  7. package/dist/index.js +632 -27
  8. package/dist/index.js.map +1 -1
  9. package/dist/maintenance-runner.js +39 -1
  10. package/dist/maintenance-runner.js.map +1 -1
  11. package/dist/memcode-runtime/CHANGELOG.md +12 -0
  12. package/dist/sdk.d.ts +1 -1
  13. package/dist/sdk.js +632 -27
  14. package/dist/sdk.js.map +1 -1
  15. package/dist/types.d.ts +38 -1
  16. package/dist/types.js.map +1 -1
  17. package/docs/1.2.7-CONTEXT-CONTINUITY.md +68 -0
  18. package/docs/API_REFERENCE.md +6 -2
  19. package/docs/dev-log/progress.txt +23 -0
  20. package/docs/hooks-architecture.md +2 -1
  21. package/package.json +1 -1
  22. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  23. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  24. package/plugins/copilot/memorix/plugin.json +1 -1
  25. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  26. package/plugins/omp/memorix/extensions/memorix.js +17 -0
  27. package/plugins/omp/memorix/package.json +1 -1
  28. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  29. package/plugins/pi/memorix/extensions/memorix.js +17 -0
  30. package/plugins/pi/memorix/package.json +1 -1
  31. package/src/cli/capability-map.ts +1 -0
  32. package/src/cli/command-guide.ts +10 -0
  33. package/src/cli/commands/checkpoint.ts +144 -0
  34. package/src/cli/index.ts +3 -1
  35. package/src/codegraph/auto-context.ts +51 -5
  36. package/src/hooks/handler.ts +103 -11
  37. package/src/hooks/normalizer.ts +85 -1
  38. package/src/hooks/types.ts +16 -0
  39. package/src/knowledge/workset.ts +43 -2
  40. package/src/memory/compaction.ts +165 -0
  41. package/src/server/tool-profile.ts +1 -0
  42. package/src/server.ts +94 -0
  43. package/src/store/compaction-checkpoint-store.ts +397 -0
  44. package/src/store/sqlite-db.ts +41 -0
  45. package/src/types.ts +46 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.2.7] - 2026-07-27
6
+
7
+ ### Added
8
+ - **Native compaction continuity** -- Memorix records host-native compaction lifecycle checkpoints separately from durable memory. Pi and Oh-my-Pi preserve the native summary fields their extension API exposes; Codex and Claude Code keep an honest lifecycle marker when their hook payload exposes no summary.
9
+ - **One-time host recovery** -- Codex receives one bounded checkpoint through its documented `SessionStart` compact path. Claude Code receives the same bounded checkpoint through its documented next `UserPromptSubmit` context path. Neither path replays a transcript or repeats delivery.
10
+ - **Claude handoff routing** -- Claude Code now receives a compact official `UserPromptSubmit` hint for handoff and continuation requests, directing one Memory Autopilot call before broad file or Git exploration without injecting a broad brief into unrelated prompts.
11
+ - **Cross-agent continuation evidence** -- Explicit `memorix resume` / task continuation Worksets can include one recent, source-labelled compact checkpoint from the same Git project. It remains historical lifecycle evidence, not promoted knowledge.
12
+ - **Checkpoint CLI and advanced MCP inspection** -- Added `memorix checkpoint list|show|context|archive`; the matching `memorix_compaction_checkpoint` MCP action is available only in the `full` profile.
13
+
14
+ ### Fixed
15
+ - **Repeated compact lifecycle safety** -- Retried pre-compact and post-compact hook delivery is idempotent. Multiple real compactions in one long host session retain separate checkpoints when the host exposes a new preflight marker or native compaction event ID.
16
+
5
17
  ## [1.2.6] - 2026-07-27
6
18
 
7
19
  ### Added
package/README.md CHANGED
@@ -177,7 +177,7 @@ Integration surfaces:
177
177
  | Setup command | Installs the recommended one-time user-level Memorix integration | `memorix setup --agent <agent> --global` |
178
178
  | MCP | Gives an agent compact Memorix tools for project context, search, detail retrieval, storage, and resolution | bundled in setup packages or `memorix serve` |
179
179
  | Usage guidance | Teaches an agent when and how to use Memorix without forcing memory lookup on every prompt | bundled or generated by `memorix setup` |
180
- | Hooks | Optional auto-capture of prompts, tool events, file edits, and session lifecycle events where the agent exposes hooks | bundled or generated by `memorix setup` |
180
+ | Hooks | Optional capture of prompts, tool events, file edits, session lifecycle events, and native compaction checkpoints where the agent exposes them | bundled or generated by `memorix setup` |
181
181
  | Plugin or bundle package | Installs plugin, compatible-bundle, or package files where the agent supports them | Claude Code, Codex, GitHub Copilot CLI, Antigravity, OpenClaw, Hermes Agent, Oh-my-Pi, Pi |
182
182
  | Extension | Installs extension files where the agent supports them | Gemini CLI |
183
183
  | Local plugin | Installs local plugin files where the agent loads them directly | OpenCode |
@@ -318,6 +318,7 @@ npm uninstall -g memorix
318
318
 
319
319
  ```bash
320
320
  memorix --cwd /path/to/repo resume "continue release blocker"
321
+ memorix checkpoint list
321
322
  memorix memory search --query "release blocker"
322
323
  memorix memory --help
323
324
 
@@ -354,10 +355,11 @@ This opens memcode, a terminal coding agent that uses the same Memorix project m
354
355
  | Reasoning Memory | rationale, alternatives, constraints, risks | "Why did we choose this?" |
355
356
  | Git Memory | commit-derived engineering facts | "What changed and where?" |
356
357
  | Code Memory | files, symbols, import edges, and memory-to-code freshness | "Which current code should I inspect first?" |
358
+ | Compact Continuity | recent host-native compact summaries or lifecycle markers | "What survived the last context compaction?" |
357
359
 
358
360
  Search is project-scoped by default. `scope="global"` searches across projects. The search boosts Git Memory for "what changed" questions and reasoning records for "why" questions.
359
361
 
360
- `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 and up to three readable durable anchors. Agents should read the suggested files before trusting stored memory.
362
+ `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 checkpoint is lifecycle evidence, not durable memory or a transcript backup. Agents should read the suggested files before trusting stored memory.
361
363
 
362
364
  <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>
363
365
 
@@ -369,11 +371,12 @@ Search is project-scoped by default. `scope="global"` searches across projects.
369
371
  | Run shared HTTP MCP plus dashboard | `memorix background start` |
370
372
  | Debug HTTP MCP in the foreground | `memorix serve-http --port 3211` |
371
373
  | Inspect or manage memory directly | `memorix memory`, `memorix reasoning`, `memorix session`, `memorix ingest` |
374
+ | Inspect native compaction continuity | `memorix checkpoint list|show|context|archive` |
372
375
  | Use the interactive terminal memory control plane | `memorix workbench` |
373
376
  | Use the bundled terminal agent | `memorix` or `memcode` |
374
377
  | Run orchestrated subagent work | `memorix orchestrate --goal "..."` |
375
378
 
376
- `memorix serve` defaults to `--mode micro` (7 tools) to keep MCP tool schemas small for agents. Use `--mode lite` for the extended solo memory surface, `--mode team` for coordination tools, or `--mode full` for advanced and compatibility tools.
379
+ `memorix serve` defaults to `--mode micro` (7 tools) to keep MCP tool schemas small for agents. Use `--mode lite` for the extended solo memory surface, `--mode team` for coordination tools, or `--mode full` for advanced and compatibility tools such as checkpoint inspection.
377
380
 
378
381
  `memorix orchestrate` uses the current checkout for single-worker runs. When running multiple workers, it creates task worktrees under `.worktrees/` and merges successful task branches back. Use `--isolated` to force worktree isolation for one worker, `--no-worktree` to disable it, `--allow-dirty` to run with uncommitted changes, and `--no-auto-merge` to preserve task worktrees for manual review.
379
382
 
package/README.zh-CN.md CHANGED
@@ -177,7 +177,7 @@ Memorix 通过目标 Agent 已有的接口接入:插件包、MCP、项目规
177
177
  | Setup 命令 | 一次性安装推荐的用户级 Memorix 接入 | `memorix setup --agent <agent> --global` |
178
178
  | MCP | 给 Agent 提供搜索、详情检索、写入、reasoning 和协同工具 | setup 包内置,或手动运行 `memorix serve` |
179
179
  | 使用规范 | 告诉 Agent 什么时候、怎么使用 Memorix,而不是每轮都强制查记忆 | 由 `memorix setup` 打包或生成 |
180
- | Hooks | 在 Agent 支持时可选地自动捕获 prompt、tool 事件、文件编辑和 session 生命周期 | 由 `memorix setup` 打包或生成 |
180
+ | Hooks | 在 Agent 支持时可选地捕获 prompt、tool 事件、文件编辑、session 生命周期和原生上下文压缩检查点 | 由 `memorix setup` 打包或生成 |
181
181
  | 插件 / Bundle / Package | 给支持插件、兼容 bundle 或 package 的 Agent 安装对应文件 | Claude Code、Codex、GitHub Copilot CLI、Antigravity、OpenClaw、Hermes Agent、Oh-my-Pi、Pi |
182
182
  | Extension | 给支持 extension 的 Agent 安装对应文件 | Gemini CLI |
183
183
  | 本地插件 | 给直接加载本地插件文件的 Agent 安装插件 | OpenCode |
@@ -318,6 +318,7 @@ npm uninstall -g memorix
318
318
 
319
319
  ```bash
320
320
  memorix --cwd /path/to/repo resume "继续处理发布阻塞问题"
321
+ memorix checkpoint list
321
322
  memorix memory search --query "release blocker"
322
323
  memorix memory --help
323
324
 
@@ -354,10 +355,11 @@ memcode
354
355
  | Reasoning Memory | 原因、替代方案、约束、风险 | “当时为什么这么选?” |
355
356
  | Git Memory | 从 commit 提炼出的工程事实 | “最近改了什么,在哪些文件?” |
356
357
  | Code Memory | 文件、符号、import 关系、记忆到代码的新鲜度 | “现在应该先看哪些代码?” |
358
+ | Compact Continuity | 最近一次宿主原生压缩的摘要或生命周期标记 | “上次上下文压缩后留下了什么?” |
357
359
 
358
360
  默认搜索当前项目。`scope="global"` 可以跨项目搜索。“改了什么”优先匹配 Git Memory,“为什么”优先匹配 reasoning / decision 记录。
359
361
 
360
- `memorix context "..."` 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 `memorix resume "..."`,只会补入最近一份有用的会话总结和最多三条当前可读的长期记忆锚点。Agent 应该先读 suggested files,再相信历史记忆。
362
+ `memorix context "..."` 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 `memorix resume "..."`,只会补入最近一份有用的会话总结、最多三条当前可读的长期记忆锚点,以及最多一条带来源标识的近期宿主压缩检查点。检查点只是生命周期证据,不是长期记忆,也不是聊天记录备份。Agent 应该先读 suggested files,再相信历史记忆。
361
363
 
362
364
  <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>
363
365
 
@@ -369,6 +371,7 @@ memcode
369
371
  | 启动共享 HTTP MCP 和 Dashboard | `memorix background start` |
370
372
  | 前台调试 HTTP MCP | `memorix serve-http --port 3211` |
371
373
  | 直接检查或管理记忆 | `memorix memory`、`memorix reasoning`、`memorix session`、`memorix ingest` |
374
+ | 检查原生上下文压缩连续性 | `memorix checkpoint list|show|context|archive` |
372
375
  | 使用交互式终端记忆控制台 | `memorix workbench` |
373
376
  | 使用内置终端 Agent | `memorix` 或 `memcode` |
374
377
  | 运行编排式 subagent 工作 | `memorix orchestrate --goal "..."` |