Skip to content

Commit 53d9db7

Browse files
committed
release: publish csep 1.3.0
1 parent 301371e commit 53d9db7

25 files changed

Lines changed: 494 additions & 118 deletions

‎AGENTS.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
## Project Structure & Module Organization
44

5-
This is a Python 3.11+ package using a `src/` layout. Core code lives in `src/codex_self_evolution/`: `cli.py` and `csep.py` expose command-line entry points, `hooks/` handles Codex lifecycle hooks, `review/` handles stop-review providers, `compiler/` promotes suggestions into memory/recall/skills, and `managed_skills/` publishes generated skills. Tests live in `tests/`, with fixtures under `tests/fixtures/`. Documentation and implementation notes live in `docs/` and `notes/`. README images are kept under `docs/assets/` as SVG sources plus committed PNG renderings. Plugin manifests are present in both `src/codex_self_evolution/plugin_bundle/.codex-plugin/` and `plugins/codex-self-evolution/.codex-plugin/`; keep them aligned when changing hook metadata.
5+
This is a Python 3.11+ package using a `src/` layout. Core code lives in `src/codex_self_evolution/`: `cli.py` and `csep.py` expose command-line entry points, `hooks/` handles Codex lifecycle hooks, `session_recall/` archives and searches historical sessions, `session_reflection/` handles background memory/skill review, and `plugin_bundle/` packages the Codex plugin. Generated plugin skills are mirrored under both `skills/` and `plugins/codex-self-evolution/skills/`. Tests live in `tests/`. Documentation and implementation notes live in `docs/`. README images are kept under `docs/assets/`. Plugin manifests are present in both `src/codex_self_evolution/plugin_bundle/.codex-plugin/` and `plugins/codex-self-evolution/.codex-plugin/`; keep them aligned when changing hook metadata.
66

77
## Build, Test, and Development Commands
88

99
- `python -m pip install -e .` installs the package locally with `codex-self-evolution` and `csep` console scripts.
1010
- `python -m pip install -e '.[dev]'` adds contributor tooling such as `pytest`, `build`, and `twine`.
1111
- `python -m pytest -q` runs the full test suite; CI runs this on Python 3.11 and 3.12.
1212
- `make test PYTHON=python3.11` runs the same pytest command through the Makefile.
13-
- `make preflight PYTHON=python3.11` runs `compile-preflight` against the local `data/` state directory.
1413
- `python -m build` builds source and wheel distributions.
1514
- `scripts/install.sh` installs the local CLI with `uv` and refreshes the Codex plugin cache.
1615

@@ -20,7 +19,7 @@ Use 4-space indentation, type hints where they clarify interfaces, and small std
2019

2120
## Testing Guidelines
2221

23-
Use pytest. Name tests `test_*.py` and test functions `test_*`. Add focused coverage beside the behavior being changed, especially for storage state transitions, hook payload handling, CLI flags, and compiler promotion logic. Provider smoke tests require real credentials and are not part of public CI.
22+
Use pytest. Name tests `test_*.py` and test functions `test_*`. Add focused coverage beside the behavior being changed, especially for storage state transitions, hook payload handling, CLI flags, session recall behavior, session reflection validation, and diagnostics/status output. Provider smoke tests require real credentials and are not part of public CI.
2423

2524
## Commit & Pull Request Guidelines
2625

‎README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Codex Self-Evolution Plugin,简称 `csep`。它在 `SessionStart` 时把稳定
3939

4040
| 能力 | 写入时机 | 下一次如何使用 |
4141
| --- | --- | --- |
42-
| Stable Memory | 达到 trigger 条件后,由 session reflection 写入 `USER.md` / `MEMORY.md` | `SessionStart` 自动注入 Codex 上下文 |
42+
| Stable Memory | 达到 trigger 条件后,由 session reflection 写入 `MEMORY.md` / `memory/refs/` | `SessionStart` 自动注入 `MEMORY.md` |
4343
| Session Recall | `Stop` hook 把 transcript 归档到本地 SQLite/FTS;插件内置 `csep-session-recall` skill 教 Codex 如何检索 | `csep recall "needle1|needle2"` 像 `rg` 一样按当前 repo 或全局检索历史证据 |
4444
| Reflection Skills | reflection worker 写入 `~/.codex/skills/csep-reflect-*` | Codex 原生 skills loader 自动加载 |
4545
| Runtime Status | hooks、配置、日志、reflection job、recall DB 都可只读检查 | `csep status` 排查当前运行状态 |
@@ -162,11 +162,12 @@ csep recall --recent
162162
└── projects/
163163
└── -Users-you-code-repo/
164164
└── memory/
165-
├── USER.md
166-
└── MEMORY.md
165+
├── MEMORY.md
166+
└── refs/
167+
└── ...
167168
```
168169

169-
每个 repo 会按绝对路径分配独立 bucket。业务仓库保持干净,运行时状态留在用户 home 目录。
170+
每个 repo 会按绝对路径分配独立 bucket。`MEMORY.md` 是唯一默认注入的热上下文;`refs/` 保存按需读取的长资料,不会在 `SessionStart` 自动展开。旧 `USER.md` 如果存在会保留在磁盘上,但新版本只在 `status` 中提示 ignored。
170171

171172
## 安全边界
172173

@@ -175,6 +176,7 @@ csep recall --recent
175176
- provider secret 不进仓库,密钥放在 `~/.codex-self-evolution/.env.provider`。
176177
- runtime state 不写进业务仓库。
177178
- `csep-reflect-*` 之外的 skill 不会被当作有效产物。
179+
- memory 写入只接受当前 repo bucket 下的 `MEMORY.md` 和 `memory/refs/**/*.md`。
178180
- child thread 的口头声明不算数,父进程只认 `receipt.json` 和校验结果。
179181
- hook 前台不做长耗时工作,避免影响 Codex 正常退出。
180182

‎README_en.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ After a few days with Codex, the real drag is usually not the big task. It is th
3939

4040
| Capability | When it writes | How the next session uses it |
4141
| --- | --- | --- |
42-
| Stable Memory | After the trigger policy fires, session reflection writes `USER.md` / `MEMORY.md` | `SessionStart` injects it into Codex context |
42+
| Stable Memory | After the trigger policy fires, session reflection writes `MEMORY.md` / `memory/refs/` | `SessionStart` injects `MEMORY.md` into Codex context |
4343
| Session Recall | The `Stop` hook archives transcripts into local SQLite/FTS, and the bundled `csep-session-recall` skill teaches Codex how to search | `csep recall "needle1|needle2"` searches historical evidence like `rg`, scoped to the current repo unless `--global` is explicit |
4444
| Reflection Skills | The reflection worker writes `~/.codex/skills/csep-reflect-*` | Codex loads them through the native skills loader |
4545
| Runtime Status | Hooks, config, logs, reflection jobs, and recall DB are read-only inspectable | `csep status` shows the current runtime state |
@@ -162,11 +162,12 @@ Default runtime root:
162162
└── projects/
163163
└── -Users-you-code-repo/
164164
└── memory/
165-
├── USER.md
166-
└── MEMORY.md
165+
├── MEMORY.md
166+
└── refs/
167+
└── ...
167168
```
168169

169-
Each repo gets a bucket based on its absolute path. Application repos stay clean; runtime state stays in the user's home directory.
170+
Each repo gets a bucket based on its absolute path. `MEMORY.md` is the only hot context injected by default; `refs/` stores long-form material that agents can open on demand. A legacy `USER.md`, if present, is kept on disk but ignored by the current runtime.
170171

171172
## Safety Boundaries
172173

@@ -175,6 +176,7 @@ Each repo gets a bucket based on its absolute path. Application repos stay clean
175176
- Provider secrets do not go into the repo. Put them in `~/.codex-self-evolution/.env.provider`.
176177
- Runtime state does not get written into application repos.
177178
- Skills outside the `csep-reflect-*` namespace are not accepted as generated artifacts.
179+
- Memory writes are accepted only for the current repo bucket's `MEMORY.md` and `memory/refs/**/*.md`.
178180
- The child thread's natural-language claim is not trusted; the parent process validates `receipt.json`.
179181
- Foreground hooks do not run long model work, so Codex can exit normally.
180182

‎docs/architecture.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CSEP 只做一件事:让本机 Codex session 的经验能在后续 session 中
1010

1111
| 线 | 写入 | 使用 |
1212
| --- | --- | --- |
13-
| Stable Memory | session reflection 写 `USER.md` / `MEMORY.md` | `SessionStart` 注入当前 Codex session |
13+
| Stable Memory | session reflection 写 `MEMORY.md` / `memory/refs/` | `SessionStart` 注入 `MEMORY.md` |
1414
| Reflection Skills | session reflection 写 `~/.codex/skills/csep-reflect-*` | Codex 原生 skills loader 加载 |
1515
| Session Recall | `Stop` hook 或 backfill 归档 transcript 到 SQLite/FTS | `csep recall` 按 repo 或全局召回历史片段 |
1616

@@ -19,7 +19,7 @@ CSEP 只做一件事:让本机 Codex session 的经验能在后续 session 中
1919
```text
2020
Codex SessionStart
2121
-> csep session-start --from-stdin
22-
-> 读取当前 repo bucket 的 USER.md / MEMORY.md
22+
-> 读取当前 repo bucket 的 MEMORY.md
2323
-> 注入 stable background 和极短 recall skill pointer
2424
2525
Codex 正常工作
@@ -34,7 +34,7 @@ Codex Stop
3434
Session Reflection Worker
3535
-> 通过 Codex app-server fork 当前 thread
3636
-> child Codex review memory 和 skill
37-
-> child 原子写 memory / csep-reflect-* skill / receipt.json
37+
-> child 原子写 MEMORY.md / refs / csep-reflect-* skill / receipt.json
3838
-> parent 校验 receipt、路径、hash、skill 前缀
3939
-> 更新 job 状态和 trigger counters
4040
@@ -66,11 +66,12 @@ csep recall
6666
└── projects/
6767
└── <repo-bucket>/
6868
└── memory/
69-
├── USER.md
70-
└── MEMORY.md
69+
├── MEMORY.md
70+
└── refs/
71+
└── ...
7172
```
7273

73-
业务仓库不保存运行时状态。每个 repo 按绝对路径分配 bucket;worktree 场景会尽量解析到稳定的 repo scope。
74+
业务仓库不保存运行时状态。每个 repo 按绝对路径分配 bucket;worktree 场景会尽量解析到稳定的 repo scope。`MEMORY.md` 是默认注入文件;`refs/` 只作为按需引用区,旧 `USER.md` 如存在会被忽略。
7475

7576
## 命令面
7677

‎docs/getting-started.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ Stop -> csep session-stop --from-stdin
120120
```bash
121121
REPO=$(pwd)
122122
BUCKET=~/.codex-self-evolution/projects/$(python3 -c "import os; print(os.getcwd().replace('/', '-'))")
123-
mkdir -p "$BUCKET/memory"
124-
cat > "$BUCKET/memory/USER.md" <<'EOF'
125-
# User stable background
123+
mkdir -p "$BUCKET/memory/refs"
124+
cat > "$BUCKET/memory/MEMORY.md" <<'EOF'
125+
# Project Memory
126+
126127
My favorite test passphrase is XANADU_RIVER_442.
127128
EOF
128129
```
@@ -136,7 +137,7 @@ codex exec --json 'What is my favorite test passphrase?' 2>/dev/null | grep -i X
136137
看到 passphrase 即表示 `SessionStart` 已把 stable background 注入当前会话。测试后清理:
137138

138139
```bash
139-
rm "$BUCKET/memory/USER.md"
140+
rm "$BUCKET/memory/MEMORY.md"
140141
```
141142

142143
## 5. 验证 Stop Hook 与 Reflection

‎docs/session-reflection.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ csep session-reflect --job <job_id>
7979
Child Codex 只能写两类产物:
8080

8181
1. 当前 repo bucket 的 memory:
82-
- `USER.md`
8382
- `MEMORY.md`
83+
- `refs/**/*.md`
8484
2. 用户 Codex skills 目录下的 `csep-reflect-*` skill。
8585

8686
Child 必须写 `receipt.json`,声明:
@@ -97,7 +97,7 @@ Parent 校验:
9797

9898
- receipt 必须是合法 JSON object。
9999
- job / parent / child id 必须匹配。
100-
- memory path 必须落在允许的 memory root 下。
100+
- memory path 只接受当前 repo bucket 下的 `MEMORY.md` 和 `memory/refs/**/*.md`;旧 `USER.md` 不再是合法写入目标。
101101
- skill path 必须落在 skills root 下,且名称必须以 `csep-reflect-` 开头。
102102
- 文件 hash 必须和 receipt 声明一致。
103103

0 commit comments

Comments
 (0)