Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 1.3.3 - 2026-07-28

- Let users bind confirmed and challenged memory references when recording a real Context outcome.
- Surface challenged memory references in the Trust ledger as review signals without automatically mutating Claim or Judgment authority.
- Show the confirmed and challenged reference counts on recorded Context outcomes.

## 1.3.2

- Make the top-level `agent-context` command support the complete preview and compile lifecycle instead of returning preview-only output.
- Stop treating the retired Markdown card cache as the authoritative judgment health signal or injecting it into agent context.
- Keep the advertised agent modes aligned with the modes accepted by the backend and reject unsupported modes before queueing work.
- Point generated agent guidance and adapters at the reviewed Context Store and Judgment Store lifecycle.
- Report the full pending-confirmation count on Home instead of presenting the eight-item display budget as the total.
- Add real review routes to Trust and collapse long evidence categories with native disclosure controls.
- Add an owner-only `learning-review` preview and explicitly confirmed Feishu reminder without duplicating the Claim or Judgment state machines.

## 1.3.1

- Move private identity aliases and categories out of public source code into local configuration, and make owner-only defaults work for every installation.
Expand Down
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div align="center">

![Version](https://img.shields.io/badge/version-v1.3.1-111827.svg)
![Version](https://img.shields.io/badge/version-v1.3.3-111827.svg)
![Python](https://img.shields.io/badge/python-3.9%2B-3776AB.svg?logo=python&logoColor=white)
![Platform](https://img.shields.io/badge/platform-Codex%20%7C%20Claude%20Code%20%7C%20Local%20Agent-0F766E.svg)
![License](https://img.shields.io/badge/license-MIT-059669.svg)
Expand Down Expand Up @@ -106,8 +106,9 @@ immortal-memory train --smoke --build-role --goal "writing review" --mode writer
# 看看给 agent 的入口长什么样
immortal-memory agent-entry

# 针对一个具体任务,生成贴身的上下文包
immortal-memory agent-context "help me review this product idea" --print
# 先生成可审阅预览,再用返回的 ID 和 hash 编译
immortal-memory agent-context "help me review this product idea" --mode reviewer
immortal-memory agent-context "help me review this product idea" --mode reviewer --preview-id "<preview_id>" --preview-hash "<preview_hash>" --print
```

### 自动接入你的高质量语料
Expand Down Expand Up @@ -152,6 +153,29 @@ immortal-memory agent-factory

看板有七个真实模块:**首页、记忆、我、判断、使用、信任、系统**。首页回答今天新增了什么价值;「记忆」追溯原始证据;「我」展示 Living Self 的八个认知分区;「判断」管理判断卡;「使用」预览并编译 Context Pack;「信任」解释归因、隐私排除和纠正;「系统」展示采集、索引、备份、服务与版本健康。

### 飞书学习审核提醒

先在本机预览待确认内容,不会发送消息:

```bash
immortal-memory learning-review
immortal-memory learning-review --json
```

发送前可以让飞书 CLI 只预演请求。收件人固定读取本机私有配置中的 `feishu.expected_user_open_id`,不能临时改成群或其他人:

```bash
immortal-memory learning-review --send-feishu --dry-run --json
```

只有明确确认远端写入才会以机器人身份发送本人私聊提醒:

```bash
immortal-memory learning-review --send-feishu --confirm-remote-write
```

提醒只包含经过凭证和本机路径脱敏的有限候选摘要,以及本机审核面板入口。它不会自动确认、拒绝或升级任何 Claim 和 Judgment,也不会自动加入每日调度。真实审核仍在 Home 和 Trust 中完成,所有状态变化继续使用原有事件账本。

### 从 v1.0 做隔离迁移演练

下面这组命令只完成隔离恢复和迁移演练,不会切换生产。不要直接在生产 vault 上试跑。先创建异盘备份并通过严格恢复校验,再把 v1.0 vault 恢复到独立 staging 目录。含无时区 Hermes 时间戳时,必须先准备经哈希绑定的私有时区合同,并把参数同时传给 staging 和 migration:
Expand Down Expand Up @@ -234,7 +258,7 @@ immortal-memory backup-status --verify --max-age-hours 168 --json
immortal-memory health --max-age-hours 72
immortal-memory doctor
immortal-memory preflight
immortal-memory agent-context "release acceptance" --print
immortal-memory agent-context "release acceptance" --mode reviewer
```

系统看板会把主流程、自动反馈和本机通知分开显示。`run` 成功不等于整条自动化成功:飞书来源部分失败或通知未送达时,反馈卡和调度器都会明确标为需要关注。
Expand All @@ -244,13 +268,13 @@ immortal-memory agent-context "release acceptance" --print
```bash
CLEAN_HOME="$(mktemp -d /tmp/immortal-clean-home.XXXXXX)"
python3 -m venv "$CLEAN_HOME/venv"
WHEEL="$(find "$(pwd)/dist" -maxdepth 1 -name 'immortal_memory-1.3.1-*.whl' | head -n 1)"
WHEEL="$(find "$(pwd)/dist" -maxdepth 1 -name 'immortal_memory-1.3.3-*.whl' | head -n 1)"
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/python" -m pip install "$WHEEL"
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" init --owner-display-name "Clean Install" --alias "clean"
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" train --smoke
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" health --max-age-hours 72
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" preflight
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" agent-context "clean install acceptance" --print
HOME="$CLEAN_HOME" "$CLEAN_HOME/venv/bin/immortal-memory" agent-context "clean install acceptance" --mode reviewer
```

空白 vault 尚未配置外置备份或每日调度时,`health` 和 `preflight` 应明确返回待配置项,不能假装健康;clean-install 验收关注命令可运行、状态诚实、数据只写入隔离 `HOME`。生产验收则要求前述健康命令全部通过。
Expand All @@ -272,9 +296,9 @@ Windows 原生运行。
给本地 agent 一段这样的交接说明就行:

```text
先读 ~/.immortal/agent/ENTRY.md。然后运行:
immortal-memory agent-context "<当前任务>" --print
把返回的内容当作任务级记忆来用,默认不要直接去读原始库
先读 ~/.immortal/agent/ENTRY.md。运行 agent-context --mode reviewer 生成预览。
审阅 context_json 后,用同一任务、--preview-id 和 --preview-hash 再运行一次并加 --print
只有 lifecycle_status=compiled 时才把输出当作任务级记忆,默认不直接读原始库
```

这套模式对下面这些都成立:
Expand All @@ -284,7 +308,7 @@ immortal-memory agent-context "<当前任务>" --print
| Codex | 装 `adapters/codex/skills/immortal-memory` |
| Claude Code | 装 `adapters/claude-code/skills/immortal-memory` |
| 通用 CLI agent | 直接跑 `immortal-memory agent-context` |
| MCP / HTTP | 通过 Agent Bridge 扩展(规划中) |
| MCP / HTTP | 通过本地 Agent Bridge |

## 项目结构

Expand Down Expand Up @@ -407,7 +431,7 @@ cd immortal-memory
python3 install.py --owner-display-name "Your Name" --alias "Your Alias" --install-codex-adapter
immortal-memory train --smoke --build-role --goal "writing review" --mode writer
immortal-memory agent-entry
immortal-memory agent-context "help me review this product idea" --print
immortal-memory agent-context "help me review this product idea" --mode reviewer
```

Open the local dashboard:
Expand All @@ -431,9 +455,9 @@ not load Python from the private vault.
Hand a local agent this:

```text
Read ~/.immortal/agent/ENTRY.md first. Then run:
immortal-memory agent-context "<current task>" --print
Use the returned context as task-local memory. Do not read the raw vault by default.
Read ~/.immortal/agent/ENTRY.md first. Preview with an explicit mode, review
context_json, then compile the same task with --preview-id and --preview-hash.
Use output only when lifecycle_status=compiled. Do not read the raw vault.
```

This works for Codex, Claude Code, terminal agents, and any tool that can read local files and run shell commands.
Expand Down
58 changes: 58 additions & 0 deletions STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Immortal Memory 当前状态

更新时间:2026-07-28 15:24 CST
当前本地版本:1.3.3
本轮层级:本地源码已验证,本机真实安装已验证,GitHub 发布以远端 `v1.3.3` Release 为准

## 已完成

- 修复健康检查继续读取退役 Markdown 卡片缓存而产生的假告警,判断力健康状态现在读取当前编排状态。
- 移除 Agent 上下文对退役、未审核卡片文件的直接注入,改为使用 Judgment Store 的当前数据和评估记录。
- 补齐顶层 `agent-context` 命令的预览、审核、编译参数,真实跑通 `preview` 到 `compiled` 生命周期。
- 修正 Control Center 展示的 Agent 模式与后端可接受模式不一致的问题,无效模式会在入队前返回 `400`。
- 更新 Codex、Claude Code 适配器和使用文档,明确 Agent 只能消费已编译上下文,不能把预览当成已批准记忆。
- Claude Desktop 的 MCP 配置已指向正式安装目录,不再指向旧版私有 skill 副本。
- MCP 握手版本改为读取产品统一版本,当前正确报告 `1.3.3`。
- 首页待确认数量改为报告真实总数,不再把八条展示上限误报为全部数量。
- Trust 页增加候选理解和候选判断的真实审核入口,长证据分类改为原生折叠面板。
- 新增 owner-only `learning-review` 命令,默认只生成脱敏预览;飞书发送固定使用本机配置中的本人 open_id,并要求显式远端写入确认。
- Context 结果表单现在能把已编译记忆逐条标为「确认为有用」或「标记为需复核」,真实写入 `confirmed_refs` 和 `challenged_refs`。
- Trust 账本新增「任务结果提出复核」,从 Outcome Store 读取被挑战的精确记忆引用,但不会自动改写 Claim 或 Judgment 权威。
- 已记录的 Context 结果会展示支持与需复核的引用数量,用户能看到反馈是否真正落库。
- 本机核心、Codex 适配器、Claude Code 适配器和控制中心已更新到同一份源码。

## 验收证据

- 全量测试:Python 3.11 下 `1332 passed in 78.75s`。
- Python 3.13 临时环境先得到 `1331 passed`,仅隔离 venv 的 `ensurepip` 因解释器自身 `SIGABRT` 失败;同一测试及全量套件已在支持环境 Python 3.11 通过。
- 学习审核、产品数据、UI、HTTP、打包和版本聚焦回归:`145 passed`。
- 产品数据、HTTP 与 UI 聚焦回归:`168 passed`。
- 聚焦回归:`51 passed`,新增 MCP 版本回归单测单独通过。
- 隐私扫描:`private_scan=ok`。
- 构建产物:`immortal_memory-1.3.3-py3-none-any.whl` 构建成功,源码和 wheel 隐私扫描均为 `private_scan=ok`。
- CLI:`immortal 1.3.3`。
- 真实数据健康:772,017 条记录,最近自动采集、清洗、蒸馏、画像、索引、关系和质量步骤均为当前状态,质量分 100。
- Agent 上下文:真实任务预览成功,同一预览经 ID 和哈希确认后编译成功,生成 `compiled` 上下文。
- MCP:正式安装路径握手成功,提供 `immortal_agent_entry`、`immortal_agent_context`、`immortal_recall` 三个工具。
- 控制中心:`http://127.0.0.1:8765/` 正常响应,版本为 `1.3.3`;服务已重启到新核心,每日调度仍为 loaded。
- 浏览器验收:Trust 账本真实显示「结果复核 0」和「任务结果提出复核」分类,不再把缺少字段渲染为「未知」。
- 浏览器验收:首页显示 57 条待确认、当前展示 8 条;Trust 页高度由约 10,237 px 收敛至 1,359 px,审核按钮跳转成功,控制台无错误。
- 学习审核真实预览:识别 57 条候选理解、0 条候选判断,默认展示 8 条;飞书 CLI `dry-run` 成功,未实际发送、未更改候选状态。

## 仍需关注

- 当前 7.0 GB 备份在同一磁盘。18,058 个文件的严格 SHA256 校验没有缺失或不一致,但这不等于灾难恢复保护。必须由用户指定外置盘或可信同步目录后才能完成外部备份。
- 本机当前没有可写外置盘或系统同步盘。飞书机器人身份可用,但本机没有 GPG 私钥,尚不能安全生成、上传并演练加密恢复包。
- 备份扫描发现 48 个凭证形态候选。系统只报告数量,不应自动改写不可变原始记忆;外发任何备份前必须先建立隔离和脱敏策略。
- Trust 层有 57 条候选需要本人确认,Living Self 当前已确认条目为 0,Judgment Store 当前为 0。系统不能自行把推断升级为用户身份事实。
- Claude Desktop 配置已修正,但已运行的 Claude MCP 子进程仍是旧路径。退出并重新打开 Claude Desktop 后才会切换到正式核心;本轮未强杀应用,避免打断正在进行的任务。
- `MAINTENANCE_FREEZE_DESTRUCTIVE` 仍保留。没有经过恢复演练和外部备份前,不解除破坏性维护冻结。
- GitHub 公开发布已获得明确授权,目标版本为 `v1.3.3`;远端是否完成以 GitHub tag、Release 和 CI 结果为最终证据。

## 下一步门槛

1. 指定外置盘或同步目录,生成并验证外部备份,使 `loss_protection` 从 `unprotected` 变为 `protected`。
2. 在 Trust 看板中人工确认或拒绝候选记忆,生成第一版有依据的 Living Self。
可先运行 `immortal-memory learning-review` 本地预览;需要本人飞书提醒时,再显式运行 `immortal-memory learning-review --send-feishu --confirm-remote-write`。
3. 重启 Claude Desktop,验证实际 Claude 会话调用的是正式 MCP 核心。
4. 发布后核对 GitHub `v1.3.3` tag、Release、wheel 附件和远端 CI,不把本地推送成功单独当作公开发布完成。
13 changes: 10 additions & 3 deletions adapters/claude-code/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Immortal Memory

When a task depends on my personal preferences, history, writing style, project
judgment, colleague relationships, or long-term memory, run:
judgment, colleague relationships, or long-term memory, first preview the exact
task context:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --print
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer
```

Then continue using the returned context. Do not read the full raw vault by default.
Review the returned `context_json`, then compile the same preview:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer --preview-id "<preview_id>" --preview-hash "<preview_hash>" --print
```

Continue only after `lifecycle_status=compiled`. Do not read the full raw vault.
16 changes: 12 additions & 4 deletions adapters/claude-code/skills/immortal-memory/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ description: Use when a task depends on the user's personal memory, writing styl

# Immortal Memory Adapter

Before doing a task that depends on user-specific context, run:
Before doing a task that depends on user-specific context, create a reviewable
preview:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --print
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer
```

Use the returned context as task-local memory. Do not read the full raw vault by
default.
Read the returned `context_json`. A preview is not task context. After reviewing
its selection, compile that exact preview:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer --preview-id "<preview_id>" --preview-hash "<preview_hash>" --print
```

Continue only when the command reports `lifecycle_status=compiled`. Use the
printed pack as task-local memory. Do not read the full raw vault by default.

Useful commands:

Expand Down
17 changes: 12 additions & 5 deletions adapters/codex/skills/immortal-memory/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@ Private data lives in:
## Default Flow

For tasks involving the user's preferences, history, writing style, relationships,
projects, decisions, or digital agent behavior, run:
projects, decisions, or digital agent behavior, first create a reviewable preview:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --print
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer
```

Use the returned context as task-local context. Do not read the full raw vault by
default.
Read the returned `context_json`. A preview is not task context. After reviewing
its selection, compile that exact preview:

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<current task>" --mode reviewer --preview-id "<preview_id>" --preview-hash "<preview_hash>" --print
```

Continue only when the command reports `lifecycle_status=compiled`. Use the
printed pack as task-local context. Do not read the full raw vault by default.

## Commands

```bash
python3 ~/.local/share/immortal-memory/core/immortal.py health
python3 ~/.local/share/immortal-memory/core/immortal.py agent-entry
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<task>" --print
python3 ~/.local/share/immortal-memory/core/immortal.py agent-context "<task>" --mode reviewer
python3 ~/.local/share/immortal-memory/core/immortal.py recall "<topic>"
python3 ~/.local/share/immortal-memory/core/immortal.py agent-factory
```
Expand Down
3 changes: 2 additions & 1 deletion core/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ immortal-memory train
immortal-memory daily-install
immortal-memory agent-entry
immortal-memory task-compile "task" --mode auto
immortal-memory agent-context "task" --print
immortal-memory agent-context "task" --mode reviewer
immortal-memory agent-context "task" --mode reviewer --preview-id "<preview_id>" --preview-hash "<preview_hash>" --print
immortal-memory agent-factory
immortal-memory goal
immortal-memory recall "topic"
Expand Down
2 changes: 1 addition & 1 deletion core/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.3
Loading
Loading