Skip to content

Commit 4fc3ea0

Browse files
committed
chore: release 0.7.7
1 parent dda04cc commit 4fc3ea0

7 files changed

Lines changed: 32 additions & 31 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
55
[![python: 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
66

7-
Codex 自我进化插件 | Memory / Recall / Skills 自动沉淀 | 面向重度 Codex 工作流
7+
Codex 自我进化插件 | Memory / Recall / Synthesized Skills 自动沉淀 | 面向重度 Codex 工作流
88

99
![Codex Self Evolution runtime architecture](docs/assets/readme-runtime-architecture.png)
1010

@@ -33,7 +33,7 @@ SessionStart 注入背景
3333
| --- | --- | --- |
3434
| Codex CLI 最新源码版 | 已验证 | 支持 `plugins` / `codex_hooks` / `plugin_hooks` 后可原生加载插件 hooks。 |
3535
| Codex CLI 0.125.0 | 部分可用 | 可加载生成的 skills;`plugin_hooks` feature 尚不可用,需要升级 Codex。 |
36-
| Pi / Kimi | 已接入 | 默认 compiler agent backend,使用 `pi --provider kimi --model kimi-k2.6` 归纳 memory / recall / skills。 |
36+
| Pi agent backends | 已接入 | compiler 默认使用 `pi --provider kimi --model kimi-k2.6` 归纳 memory / recall;skill synthesis 默认使用 `pi --provider minimax --model MiniMax-M2.7` 合成 `csep-synth-*` skills。 |
3737
| OpenCode / opencode | 可选 | 保留为 `agent:opencode` backend,便于回退或对比。 |
3838
| 手动 CLI | 已支持 | 不依赖 Codex hooks,可直接跑 reviewer / compile / recall 调试闭环。 |
3939

@@ -269,20 +269,20 @@ Phase 2 之后,生成好的 skill 不需要手动搬运。
269269

270270
![Generated skills projection](docs/assets/readme-skill-projection.png)
271271

272-
Compiler 会维护两份内容:
272+
Skill Synthesis 会维护独立运行状态,并把通过门禁的 skill 投影给 Codex:
273273

274274
| 位置 | 角色 |
275275
| --- | --- |
276-
| `~/.codex-self-evolution/projects/<bucket>/skills/managed/` | 插件自己的 source of truth。 |
277-
| `~/.codex/skills/csep-<skill-id>/SKILL.md` | 投影给 Codex 原生 skill loader 使用。 |
276+
| `~/.codex-self-evolution/skill_synthesis/` | 全局合成状态、候选、废弃项和 receipt。 |
277+
| `~/.codex/skills/csep-synth-<skill-id>/SKILL.md` | 投影给 Codex 原生 skill loader 使用。 |
278278

279279
发布规则:
280280

281281
- 只有 active 且通过质量门禁的 skill 会投影
282282
- skill 必须有有效 YAML frontmatter
283283
- `description` 必须包含明确触发语义
284284
- 低信号、空壳、只有事实摘要的候选不会发布
285-
- 只会修改 `csep-` 前缀下的托管目录,不碰用户自己写的 skills
285+
- 只会修改 `csep-synth-` 前缀下的托管目录,不碰用户自己写的 skills
286286

287287
## CLI 命令
288288

@@ -363,10 +363,11 @@ uvx twine upload dist/*
363363
- Codex-first `SessionStart` / `Stop` 生命周期接入
364364
- provider-backed reviewer
365365
- per-repo runtime bucket
366-
- memory / recall / generated skills 晋升
367-
- generated skills 自动投影到 `~/.codex/skills/csep-*`
366+
- memory / recall 晋升
367+
- independent skill synthesis 自动投影到 `~/.codex/skills/csep-synth-*`
368368
- launchd scheduler
369369
- `agent:pi` compiler backend,默认 `kimi/kimi-k2.6` + direct-edit workspace
370+
- `agent:pi` skill synthesis backend,默认 `minimax/MiniMax-M2.7`
370371

371372
仍在演进:
372373

‎docs/getting-started.md‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# Python 3.11+
2626
python3 --version
2727

28-
# opencode 可选,但推荐装上
29-
which opencode && opencode --version
28+
# pi 用于生产默认 agent backend
29+
which pi && pi --version
3030

3131
# 至少配一个 reviewer provider 的 API key(任选)
3232
env | grep -E '^(MINIMAX|OPENAI|ANTHROPIC)_API_KEY' | sed 's/=.*/=<set>/'
@@ -149,12 +149,12 @@ EOF
149149

150150
```bash
151151
.venv/bin/python -m codex_self_evolution.cli compile \
152-
--once --state-dir $STATE --backend agent:opencode
152+
--once --state-dir $STATE --backend agent:pi
153153
```
154154

155-
> **两种 backend 的取舍**:`agent:opencode` 会真正调 opencode CLI 做一次语义级合并(dedupe + 改写更流畅,约 20–40 秒),需要本地 `opencode` 可用且已登录。`script` 走纯规则拼装(< 100ms,确定性),不依赖 LLM。调试和 CI 用 `--backend script`;生产/定时任务默认用 `agent:opencode`。
155+
> **两种 backend 的取舍**:`agent:pi` 会真正调 pi CLI 做一次语义级合并(dedupe + 改写更流畅,约 20–40 秒),默认走 `kimi/kimi-k2.6`,需要本地 `pi` 可用且 provider key 已配置。`script` 走纯规则拼装(< 100ms,确定性),不依赖 LLM。调试和 CI 用 `--backend script`;生产/定时任务默认用 `agent:pi`。
156156
>
157-
> 如果 opencode 不在 PATH 或调用失败,agent backend 会在 receipt 的 `discarded_items` 里记 `agent_invoke_failed` / `opencode_unavailable`,然后**自动 fallback 到 script**,compile 不会整个失败。
157+
> 如果 pi 不在 PATH 或调用失败,agent backend 会在 receipt 的 `discarded_items` 里记 `agent_invoke_failed`,然后**自动 fallback 到 script**,compile 不会整个失败。
158158
159159
**期望**:
160160
- `"status": "success"` + `processed_count >= 1`
@@ -277,9 +277,9 @@ JSON 丢弃(不会报错,就是"悄悄没效果")。如果模型答不出 XANADU
277277
脚本行为:
278278

279279
1. 前置检查:`codex-self-evolution` 在 PATH。若找不到,先运行 `./scripts/install.sh`。
280-
2. 自动探测本地 CLI + `opencode` 路径,相关 dir 都写进 plist `EnvironmentVariables.PATH`(launchd 默认 PATH 不含 Homebrew/usr/local/~/.local/bin,**不做这步 scheduler 要么起不来,要么永远 fallback 到 script backend**)
280+
2. 自动探测本地 CLI + `pi` 路径,相关 dir 都写进 plist `EnvironmentVariables.PATH`(launchd 默认 PATH 不含 Homebrew/usr/local/~/.local/bin,**不做这步 scheduler 要么起不来,要么永远 fallback 到 script backend**)
281281
3. 写 `~/Library/LaunchAgents/com.codex-self-evolution.preflight.plist`,`ProgramArguments` 是
282-
`[<absolute codex-self-evolution>, scan, --backend, agent:opencode]`(`ProgramArguments[0]` launchd 要求绝对路径,install 时探测)
282+
`[<absolute codex-self-evolution>, scan, --backend, agent:pi, --max-runs-per-project, 3]`(`ProgramArguments[0]` launchd 要求绝对路径,install 时探测)
283283
4. `launchctl bootout`(清老的,容错)→ `bootstrap`(新 API)加载
284284
5. 幂等:再跑一次会 bootout 后重装,仍然只有一条 job
285285

@@ -288,7 +288,7 @@ JSON 丢弃(不会报错,就是"悄悄没效果")。如果模型答不出 XANADU
288288
| 变量 | 默认值 | 说明 |
289289
| --- | --- | --- |
290290
| `CSEP_SCHEDULER_INTERVAL` | `300` | 秒。改成 `60` 更激进,`900` 更省电 |
291-
| `CSEP_SCHEDULER_BACKEND` | `agent:opencode` | `script` 禁掉语义合并(testing/debug 用) |
291+
| `CSEP_SCAN_MAX_RUNS_PER_PROJECT` | `3` | 每个 bucket 单次最多连续 drain 的 pending 数 |
292292

293293
### 4.1.1 独立 Skill Synthesis 调度
294294

@@ -353,7 +353,7 @@ codex-self-evolution status | python3 -m json.tool
353353
| `legacy_user_hooks.stop_installed` / `session_start_installed` | 旧版 user-level hook 诊断;Phase 2 正常不需要它们为 `true` |
354354
| `scheduler.loaded` / `plist_exists` | 两个都是 `true` 说明 install-scheduler.sh 装成功 + launchd 已注册 |
355355
| `env_provider.keys_set` | 至少 `["MINIMAX_API_KEY"]`(或其它你用的 provider)。**永远不打印 key 值**,只报 set/unset |
356-
| `tools.codex.version` / `opencode.version` | 两个 CLI 版本。opencode 没装 → scheduler 会 fallback 到 script backend |
356+
| `tools.codex.version` / `pi.version` | 两个 CLI 版本。pi 没装 → agent backend 会失败并 fallback 到 script backend |
357357
| `buckets[].counts` | 每个 repo 的 pending/done/failed 统计。正常状态:pending 应该短时间内变 0(scheduler 5 分钟内消化),done 稳步增长 |
358358
| `buckets[].last_receipt` | 最后一次 compile 的 run_status / backend / processed_count。**pending > 0 但 last_receipt 很久没更新 = scheduler 没跑** |
359359

@@ -466,15 +466,15 @@ pid 不存在 → lock 本应立即视为 stale,下一次 preflight 自动清。
466466

467467
reviewer 认为本轮没什么可沉淀的。换个更具体、更有"干了啥"的 `transcript` 重试。或用 `dummy` provider + 手工 `provider_stub_response` 直接注入内容。
468468

469-
### 5. `agent_invoke_failed` / `opencode_unavailable` 在 receipt 的 discarded_items 里
469+
### 5. `agent_invoke_failed` 在 receipt 的 discarded_items 里
470470

471-
说明 `agent:opencode` 调用没跑成,自动 fallback 到 script 了 —— compile 不会整体失败,但语义合并这一层丢了。常见原因:
471+
说明 `agent:pi` 调用没跑成,自动 fallback 到 script 了 —— compile 不会整体失败,但语义合并这一层丢了。常见原因:
472472

473-
- `opencode_unavailable`: `opencode` 不在 PATH。装一下(`npm i -g opencode-ai` 等)或把路径塞进环境
474-
- `agent_invoke_failed` + `exit=1 ... authentication required`: `opencode` 没登录。跑 `opencode auth login` 后再试
475-
- `agent_output_invalid` / `no assistant text`: 模型返回不是合法 JSON。设 `CODEX_SELF_EVOLUTION_OPENCODE_MODEL=<更强的模型>` 再试(默认 build 速模型偶尔会漏字段)
473+
- `pi` 不在 PATH。装好或把路径塞进环境,然后重装 scheduler 让 plist 带上路径
474+
- provider key 缺失或配额耗尽。检查 `~/.codex-self-evolution/.env.provider` 和 `config show`
475+
- `agent_output_invalid` / `no assistant text`: 模型返回不是合法 JSON。可临时切换 `CODEX_SELF_EVOLUTION_PI_MODEL=<更强的模型>` 或改用 `--backend script` 排障
476476

477-
手动重现看看 opencode 本身 OK 不:`opencode run --format json -- "reply with {\"ok\":true}"`。
477+
手动重现看看 pi 本身 OK 不:`pi -p --mode json --no-session --no-context-files --no-extensions --no-skills --no-prompt-templates --no-themes --tools read --provider kimi --model kimi-k2.6 "reply with {\"ok\":true}"`。
478478

479479
### 6. 想重置所有状态从头来一次
480480

‎plugins/codex-self-evolution/.codex-plugin/plugin.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codex-self-evolution",
3-
"version": "0.7.6",
4-
"description": "Scheduled self-evolution loop with stable background memory, provider-backed stop review, explicit suggestion states, launchd-style compiler preflight, focused recall, managed skills, and per-profile api_key_env so multiple anthropic-style providers can coexist.",
3+
"version": "0.7.7",
4+
"description": "Scheduled self-evolution loop with stable background memory, provider-backed stop review, explicit suggestion states, launchd compiler preflight, focused recall, and independent csep-synth skill synthesis.",
55
"author": {
66
"name": "T0UGH",
77
"url": "https://github.com/T0UGH"

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "codex-self-evolution-plugin"
7-
version = "0.7.6"
8-
description = "Self-evolution loop for OpenAI Codex: Stop-hook reviewer + scheduled per-repo memory/recall/skill compilation, zero runtime dependencies."
7+
version = "0.7.7"
8+
description = "Self-evolution loop for OpenAI Codex: Stop-hook reviewer, memory/recall compiler, and independent skill synthesis, zero runtime dependencies."
99
readme = "README.md"
1010
requires-python = ">=3.11"
1111
license = { file = "LICENSE" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__all__ = ["__version__"]
22

3-
__version__ = "0.7.6"
3+
__version__ = "0.7.7"

‎src/codex_self_evolution/plugin_bundle/.codex-plugin/plugin.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codex-self-evolution",
3-
"version": "0.7.6",
4-
"description": "Scheduled self-evolution loop with stable background memory, provider-backed stop review, explicit suggestion states, launchd-style compiler preflight, focused recall, managed skills, and per-profile api_key_env so multiple anthropic-style providers can coexist.",
3+
"version": "0.7.7",
4+
"description": "Scheduled self-evolution loop with stable background memory, provider-backed stop review, explicit suggestion states, launchd compiler preflight, focused recall, and independent csep-synth skill synthesis.",
55
"author": {
66
"name": "T0UGH",
77
"url": "https://github.com/T0UGH"

‎tests/test_install_script.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_install_script_uses_uv_tool_and_cleans_only_managed_hooks(tmp_path):
100100
/ "cache"
101101
/ "codex-self-evolution"
102102
/ "codex-self-evolution"
103-
/ "0.7.6"
103+
/ "0.7.7"
104104
/ ".codex-plugin"
105105
/ "plugin.json"
106106
)

0 commit comments

Comments
 (0)