Skip to content

Commit 2f25dbb

Browse files
committed
Land minimum KB bootstrap
1 parent 8b80861 commit 2f25dbb

16 files changed

Lines changed: 396 additions & 25 deletions

File tree

.sopify-skills/plan/20260313_sopify_runtime_blueprint/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,21 @@ R0 需要补齐:
119119
- 将高价值 skills 脚本化,例如 `workflow-learning``templates`
120120
- 继续保持核心流程与外围产品层解耦
121121

122+
当前已落地:
123+
124+
- `runtime/kb.py` 已接入 runtime 主链,用于首次运行时 bootstrap 最小 KB 骨架
125+
- 当前最小 KB 文件集包括 `project.md``wiki/overview.md``user/preferences.md``history/index.md`
126+
- 当前只生成基于根配置、manifest、顶层目录的轻量快照,不做源码级扫描
127+
- 该能力当前只负责“建立长期资产入口”,尚未进入选择性历史回收与 history archive
128+
122129
## 当前明确不做
123130

124131
- 不做深 `core / adapter / provider / plugin` 拆分
125132
- 不扩张面向用户的配置面
126133
- 不做全量自动加载 KB
127134
- R0 不发布 `~go exec` 的最小 develop bridge
128135
- R0 不发布 `workflow-learning` / `templates` 的 runtime 脚本化
129-
- R0 不发布 history / task state / KB bootstrap
136+
- R0 不发布 history / task state
130137
- P0 不做完整 develop 自动执行器
131138
- P0 / P1 不优先做安装器、更新器、通知、hooks 等外围产品层
132139
- 不做 marketplace 式 skill 平台

.sopify-skills/plan/20260313_sopify_runtime_blueprint/design.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,13 @@ P0 只允许读取:
353353

354354
1. 加载 config
355355
2. 加载 state
356-
3. 发现 skills
357-
4. 分类 route
358-
5. 回收最小上下文
359-
6. 持久化 route 状态
360-
7. 分支进入 scaffold / replay / runtime skill / plain Q&A
361-
8. 按需写 replay 事件
356+
3. 初始化最小 KB 骨架
357+
4. 发现 skills
358+
5. 分类 route
359+
6. 回收最小上下文
360+
7. 持久化 route 状态
361+
8. 分支进入 scaffold / replay / runtime skill / plain Q&A
362+
9. 按需写 replay 事件
362363

363364
不负责:
364365

@@ -416,12 +417,15 @@ P0 只允许读取:
416417
- 最小知识库初始化
417418
- 最小偏好持久化
418419
- 轻量项目上下文文件
419-
- 先读根配置文件,再按需扩展到目录结构和源码扫描
420+
- 当前先读取根配置、manifest、顶层目录;后续再按需扩展到源码扫描
421+
- 当前最小落地范围是首次运行时创建 `project.md``wiki/overview.md``user/preferences.md``history/index.md`
420422

421423
不负责:
422424

423425
- 智能全量文档同步
424426
- 全量自动加载知识库
427+
- history archive
428+
- 选择性历史回收策略
425429

426430
### `runtime/history.py`
427431

.sopify-skills/plan/20260313_sopify_runtime_blueprint/tasks.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,23 @@ P1 实现原则:
345345

346346
### 1. 最小 KB 支持
347347

348-
- [ ] 实现 KB bootstrap
349-
- [ ] 初始化最小 wiki 与 user 文件
350-
- [ ] 只持久化明确的长期偏好
348+
- [x] 实现 KB bootstrap
349+
- [x] 初始化最小 wiki 与 user 文件
350+
- [x] 只持久化明确的长期偏好
351351
- [ ] 优先扫描根配置文件,再按需扫描目录结构和源码
352352

353353
验收条件:
354354

355355
- KB 可以按需初始化
356356
- 偏好写入保持保守和结构化
357357

358+
当前收口说明:
359+
360+
- 已在 `runtime/kb.py` 中落地首次运行的最小 KB bootstrap
361+
- 当前最小文件集为 `project.md``wiki/overview.md``user/preferences.md``history/index.md`
362+
- 当前 `project.md` 只基于根配置、manifest、顶层目录生成快照,源码级扫描仍待后续补齐
363+
- 本轮不包含选择性历史回收与 history archive
364+
358365
### 2. 选择性历史回收
359366

360367
- [ ] 定义 P1 可参与回收的历史文件范围
@@ -414,7 +421,7 @@ P1 实现原则:
414421

415422
### 7. P1 行为测试
416423

417-
- [ ] 测试 KB bootstrap
424+
- [x] 测试 KB bootstrap
418425
- [ ] 测试选择性历史回收
419426
- [ ] 测试 history archive
420427
- [ ] 测试 task state 更新

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This changelog is maintained manually (not auto-generated).
1616

1717
### Added
1818

19+
- Minimal KB bootstrap in `runtime/kb.py`, creating `project.md`, `wiki/overview.md`, `user/preferences.md`, and `history/index.md` on first runtime execution.
1920
- New sub-skill `model-compare` (CN/EN) for configuration-driven multi-model parallel comparison with manual user selection.
2021
- New compare trigger contract:
2122
- Command: `~compare <question>`
@@ -60,6 +61,9 @@ This changelog is maintained manually (not auto-generated).
6061
- Clarified release boundary across README, blueprint, and changelog:
6162
- current minimal published slice = `runtime-backed ~go plan`
6263
- `~compare` generic-entry bridge / `~go exec` develop bridge / `workflow-learning` runtime helper remain out of scope for this slice
64+
- Clarified the next-stage boundary across runtime/docs/tests:
65+
- P1-A now lands only the minimum KB bootstrap
66+
- selective history recovery / history archive / task-state runtime remain for later P1 slices
6367

6468
## [2026-02-13] - 2026-02-13
6569

Claude/Skills/CN/skills/sopify/kb/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ description: 知识库管理技能;知识库操作时读取;包含初始化
6161
```yaml
6262
首次初始化:
6363
- .sopify-skills/project.md (必须)
64+
- .sopify-skills/wiki/overview.md
65+
- .sopify-skills/user/preferences.md (允许先创建空文件,只有明确长期偏好时才写入内容)
66+
- .sopify-skills/history/index.md
6467

6568
首个方案时:
6669
- .sopify-skills/plan/ 目录
67-
- .sopify-skills/history/index.md
6870

6971
首次涉及模块文档时:
70-
- .sopify-skills/wiki/overview.md
7172
- .sopify-skills/wiki/modules/{module}.md
7273

7374
首次涉及 API 时:
@@ -77,10 +78,13 @@ description: 知识库管理技能;知识库操作时读取;包含初始化
7778
- .sopify-skills/wiki/data.md
7879

7980
首次出现"明确长期偏好"时:
80-
- .sopify-skills/user/preferences.md
8181
- .sopify-skills/user/feedback.jsonl
8282
```
8383
84+
说明:
85+
- 当前 runtime 的最小 KB bootstrap 已落地,上述 `project.md / overview.md / preferences.md / history/index.md` 会在首次运行时创建
86+
- `preferences.md` 可提前创建为空骨架,但只有用户明确声明长期偏好时才应写入真实偏好内容
87+
8488
---
8589

8690
## 项目上下文获取

Claude/Skills/EN/skills/sopify/kb/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ Create files as needed:
6161
```yaml
6262
Initial setup:
6363
- .sopify-skills/project.md (required)
64+
- .sopify-skills/wiki/overview.md
65+
- .sopify-skills/user/preferences.md (an empty file may exist first; real preferences are written only after explicit long-term statements)
66+
- .sopify-skills/history/index.md
6467

6568
First plan:
6669
- .sopify-skills/plan/ directory
67-
- .sopify-skills/history/index.md
6870

6971
First module documentation:
70-
- .sopify-skills/wiki/overview.md
7172
- .sopify-skills/wiki/modules/{module}.md
7273

7374
First API documentation:
@@ -77,10 +78,13 @@ First data model documentation:
7778
- .sopify-skills/wiki/data.md
7879

7980
First explicit "long-term preference" statement:
80-
- .sopify-skills/user/preferences.md
8181
- .sopify-skills/user/feedback.jsonl
8282
```
8383
84+
Notes:
85+
- The current runtime already lands a minimum KB bootstrap, so `project.md / overview.md / preferences.md / history/index.md` are created on the first run
86+
- `preferences.md` may be created as an empty skeleton first, but actual preferences should still be written only for explicit long-term statements
87+
8488
---
8589

8690
## Project Context Acquisition

Codex/Skills/CN/skills/sopify/kb/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ description: 知识库管理技能;知识库操作时读取;包含初始化
6161
```yaml
6262
首次初始化:
6363
- .sopify-skills/project.md (必须)
64+
- .sopify-skills/wiki/overview.md
65+
- .sopify-skills/user/preferences.md (允许先创建空文件,只有明确长期偏好时才写入内容)
66+
- .sopify-skills/history/index.md
6467

6568
首个方案时:
6669
- .sopify-skills/plan/ 目录
67-
- .sopify-skills/history/index.md
6870

6971
首次涉及模块文档时:
70-
- .sopify-skills/wiki/overview.md
7172
- .sopify-skills/wiki/modules/{module}.md
7273

7374
首次涉及 API 时:
@@ -77,10 +78,13 @@ description: 知识库管理技能;知识库操作时读取;包含初始化
7778
- .sopify-skills/wiki/data.md
7879

7980
首次出现"明确长期偏好"时:
80-
- .sopify-skills/user/preferences.md
8181
- .sopify-skills/user/feedback.jsonl
8282
```
8383
84+
说明:
85+
- 当前 runtime 的最小 KB bootstrap 已落地,上述 `project.md / overview.md / preferences.md / history/index.md` 会在首次运行时创建
86+
- `preferences.md` 可提前创建为空骨架,但只有用户明确声明长期偏好时才应写入真实偏好内容
87+
8488
---
8589

8690
## 项目上下文获取

Codex/Skills/EN/skills/sopify/kb/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ Create files as needed:
6161
```yaml
6262
Initial setup:
6363
- .sopify-skills/project.md (required)
64+
- .sopify-skills/wiki/overview.md
65+
- .sopify-skills/user/preferences.md (an empty file may exist first; real preferences are written only after explicit long-term statements)
66+
- .sopify-skills/history/index.md
6467

6568
First plan:
6669
- .sopify-skills/plan/ directory
67-
- .sopify-skills/history/index.md
6870

6971
First module documentation:
70-
- .sopify-skills/wiki/overview.md
7172
- .sopify-skills/wiki/modules/{module}.md
7273

7374
First API documentation:
@@ -77,10 +78,13 @@ First data model documentation:
7778
- .sopify-skills/wiki/data.md
7879

7980
First explicit "long-term preference" statement:
80-
- .sopify-skills/user/preferences.md
8181
- .sopify-skills/user/feedback.jsonl
8282
```
8383
84+
Notes:
85+
- The current runtime already lands a minimum KB bootstrap, so `project.md / overview.md / preferences.md / history/index.md` are created on the first run
86+
- `preferences.md` may be created as an empty skeleton first, but actual preferences should still be written only for explicit long-term statements
87+
8488
---
8589

8690
## Project Context Acquisition

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ bash scripts/check-runtime-smoke.sh
155155

156156
预期结果:
157157

158+
- 首次运行会初始化最小 KB 骨架:
159+
- `.sopify-skills/project.md`
160+
- `.sopify-skills/wiki/overview.md`
161+
- `.sopify-skills/user/preferences.md`
162+
- `.sopify-skills/history/index.md`
158163
- 生成 `.sopify-skills/plan/`
159164
- 更新 `.sopify-skills/state/`
160165
- 写入 `.sopify-skills/replay/`
@@ -168,6 +173,8 @@ bash scripts/check-runtime-smoke.sh
168173
- `scripts/go_plan_runtime.py`:plan-only helper
169174
- 已提供 `scripts/sync-runtime-assets.sh`,用于把 runtime bundle 同步到目标仓库的 `.sopify-runtime/`
170175
- `.sopify-runtime/` bundle 内已包含便携 `tests/test_runtime.py``scripts/check-runtime-smoke.sh`
176+
- 当前 `P1-A` 已落地:首次运行会 bootstrap 最小 KB 骨架,但还不包含选择性历史回收或 history 归档
177+
- 当前 KB 快照只读取根配置、manifest 与顶层目录,不做源码级扫描
171178
- 不属于本轮发布切片:`~compare` 的通用入口自动桥接、`workflow-learning` 的独立 runtime helper、`~go exec` develop bridge
172179
- 因此当前已经适合“自用 + 二次接入”,但仍不是完整宿主安装器形态
173180

README_EN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ bash scripts/check-runtime-smoke.sh
155155

156156
Expected result:
157157

158+
- first run bootstraps the minimum KB skeleton:
159+
- `.sopify-skills/project.md`
160+
- `.sopify-skills/wiki/overview.md`
161+
- `.sopify-skills/user/preferences.md`
162+
- `.sopify-skills/history/index.md`
158163
- generate `.sopify-skills/plan/`
159164
- update `.sopify-skills/state/`
160165
- write `.sopify-skills/replay/`
@@ -168,6 +173,7 @@ Current boundary:
168173
- `scripts/go_plan_runtime.py`: plan-only helper
169174
- `scripts/sync-runtime-assets.sh` can now sync the runtime bundle into `.sopify-runtime/` in another repository
170175
- the `.sopify-runtime/` bundle already includes portable `tests/test_runtime.py` and `scripts/check-runtime-smoke.sh`
176+
- `P1-A` is now landed: the first runtime execution bootstraps the minimum KB skeleton, but this still does not include selective history recovery or history archive
171177
- not part of this release slice: generic-entry auto-bridge for `~compare`, a standalone `workflow-learning` runtime helper, and the `~go exec` develop bridge
172178
- the current shape now fits self-use and secondary integration, but it is still not a full host-side installer flow
173179

0 commit comments

Comments
 (0)