Skip to content

Commit 67cff09

Browse files
committed
Close runtime bundle sync and CI
1 parent b90fc92 commit 67cff09

13 files changed

Lines changed: 593 additions & 56 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,20 @@ jobs:
2222

2323
- name: Check version consistency
2424
run: bash scripts/check-version-consistency.sh
25+
26+
runtime-tests:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.11"
36+
37+
- name: Run runtime unit tests
38+
run: python3 -m unittest tests/test_runtime.py
39+
40+
- name: Run runtime smoke check
41+
run: bash scripts/check-runtime-smoke.sh

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
.DS_Store
22
Thumbs.db
3+
sopify.config.yaml
4+
5+
__pycache__/
6+
.pytest_cache/
7+
8+
.sopify-runtime/
9+
10+
.sopify-skills/state/
11+
.sopify-skills/replay/
12+
.sopify-skills/plan/*
13+
!.sopify-skills/plan/20260313_sopify_runtime_blueprint/
14+
!.sopify-skills/plan/20260313_sopify_runtime_blueprint/**

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ R0 需要补齐:
9696
- 仓库内新增 `scripts/sopify_runtime.py` 作为默认 repo-local 原始输入入口
9797
- `scripts/go_plan_runtime.py` 退回为 plan-only helper
9898
- `runtime/output.py` 已将 `RuntimeResult` 渲染为 Sopify 统一摘要
99-
- 本地验证已覆盖 plan / state / replay 落盘与重复执行目录冲突处理
100-
- README、AGENTS、design skill、蓝图任务单口径已对齐
99+
- `.gitignore` 已只忽略 runtime 本地产物,`tests/test_runtime.py` 不再被误忽略
100+
- 新增 `scripts/sync-runtime-assets.sh`,可把 runtime bundle 同步到目标仓库 `.sopify-runtime/`
101+
- 新增 `scripts/check-runtime-smoke.sh`,并已将 runtime unit test + smoke check 接入 CI
102+
- README、AGENTS、蓝图任务单口径已对齐
101103

102104
当前仍未收口:
103105

104-
- 面向安装分发的 runtime 资产自动同步
105-
- CI 与进仓测试纳入
106106
- `~compare` 的通用入口自动桥接
107107
- `~go exec` / `workflow-learning` 的独立 runtime helper
108108

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ P0 实现原则:
227227

228228
备注:
229229

230-
- 当前本地已有 `tests/test_runtime.py`
231-
- 是否纳入版本控制并接入 CI,跟随当前 P0 接入闭环一起决策
230+
- `tests/test_runtime.py` 已纳入版本控制
231+
- 当前 CI 已接入 runtime unit test 与 smoke check
232232

233233
## R0 目标(后置,可选)
234234

@@ -249,9 +249,9 @@ R0 实现原则:
249249

250250
### 1. 发布范围收口
251251

252-
- [ ] 明确本次发布只承诺 `runtime-backed ~go plan`
253-
- [ ] 明确 `~go` / `~go exec` / 回放 runtime 不属于本次发布承诺
254-
- [ ] 同步蓝图、README、AGENTS 的能力口径
252+
- [x] 明确本次发布只承诺 `runtime-backed ~go plan`
253+
- [x] 明确 `~go` / `~go exec` / 回放 runtime 不属于本次发布承诺
254+
- [x] 同步蓝图、README、AGENTS 的能力口径
255255

256256
验收条件:
257257

@@ -260,9 +260,9 @@ R0 实现原则:
260260

261261
### 2. 安装与分发闭环
262262

263-
- [ ] 让安装产物包含 runtime 所需代码
264-
- [ ] 保证 Codex / Claude 两侧都能拿到一致的运行时资产
265-
- [ ] 更新安装说明或同步脚本,消除“仓库里有代码、安装后没有”的断层
263+
- [x] 让安装产物包含 runtime 所需代码
264+
- [x] 保证 Codex / Claude 两侧都能拿到一致的运行时资产
265+
- [x] 更新安装说明或同步脚本,消除“仓库里有代码、安装后没有”的断层
266266

267267
验收条件:
268268

@@ -271,9 +271,9 @@ R0 实现原则:
271271

272272
### 3. `~go plan` 入口接线
273273

274-
- [ ]`~go plan` 提供稳定的宿主入口
275-
- [ ] 明确入口到 `run_runtime(...)` 的参数传递约定
276-
- [ ] 保持现有 `~compare` 运行时路径不被这次发布回归破坏
274+
- [x]`~go plan` 提供稳定的宿主入口
275+
- [x] 明确入口到 `run_runtime(...)` 的参数传递约定
276+
- [x] 保持现有 `~compare` 运行时路径不被这次发布回归破坏
277277

278278
验收条件:
279279

@@ -282,9 +282,9 @@ R0 实现原则:
282282

283283
### 4. 输出适配
284284

285-
- [ ]`RuntimeResult` 渲染为 Sopify 统一输出模板
286-
- [ ]`plan_only` 路由下稳定展示方案路径、产物文件和 Next 提示
287-
- [ ] 为失败场景补充可诊断输出
285+
- [x]`RuntimeResult` 渲染为 Sopify 统一输出模板
286+
- [x]`plan_only` 路由下稳定展示方案路径、产物文件和 Next 提示
287+
- [x] 为失败场景补充可诊断输出
288288

289289
验收条件:
290290

@@ -293,9 +293,9 @@ R0 实现原则:
293293

294294
### 5. 端到端验证
295295

296-
- [ ] 在零配置工作区验证 `~go plan <需求>`
297-
- [ ] 验证 plan / state / replay 产物是否稳定落盘
298-
- [ ] 验证重复调用和跨会话恢复不会破坏当前 plan 状态
296+
- [x] 在零配置工作区验证 `~go plan <需求>`
297+
- [x] 验证 plan / state / replay 产物是否稳定落盘
298+
- [x] 验证重复调用和跨会话恢复不会破坏当前 plan 状态
299299

300300
验收条件:
301301

@@ -304,9 +304,9 @@ R0 实现原则:
304304

305305
### 6. 测试与 CI
306306

307-
- [ ] 将 runtime 行为测试纳入版本控制
308-
- [ ] 在 CI 中增加最小 runtime 测试 job
309-
- [ ] 为发布切片补充至少一条安装后 smoke test 或等价验证
307+
- [x] 将 runtime 行为测试纳入版本控制
308+
- [x] 在 CI 中增加最小 runtime 测试 job
309+
- [x] 为发布切片补充至少一条安装后 smoke test 或等价验证
310310

311311
验收条件:
312312

Claude/Skills/CN/CLAUDE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Next: {下一步提示}
133133
| `~go exec` | 执行已有方案 |
134134
| `~compare` | 多模型并发对比(默认含当前会话模型;可用模型数不足 2 时降级并给出原因) |
135135

136-
说明:当前仓库若存在 `scripts/sopify_runtime.py`,原始输入应优先走该默认 repo-local runtime 入口;仅在明确只走 `~go plan` 时使用 `scripts/go_plan_runtime.py` 这个 plan-only helper。
136+
说明:当前仓库若存在 `scripts/sopify_runtime.py`,原始输入应优先走该默认 repo-local runtime 入口;若 runtime 以 bundle 方式接入到其他仓库,则优先走 `.sopify-runtime/scripts/sopify_runtime.py`仅在明确只走 `~go plan` 时使用对应的 `go_plan_runtime.py` helper。
137137

138138
**workflow-learning 主动记录策略:**
139139
```yaml
@@ -258,7 +258,7 @@ progressive: 按需创建文件 (默认)
258258
检查命令前缀 (~go, ~go plan, ~go exec, ~compare)
259259
260260
├─ ~go exec → 执行已有方案
261-
├─ ~go plan → 规划模式 (需求分析 → 方案设计;若存在 scripts/sopify_runtime.py 则原始输入优先走该默认入口,plan-only 场景再使用 scripts/go_plan_runtime.py)
261+
├─ ~go plan → 规划模式 (需求分析 → 方案设计;若存在 scripts/sopify_runtime.py 或 .sopify-runtime/scripts/sopify_runtime.py,则原始输入优先走默认入口,plan-only 场景再使用对应的 go_plan_runtime.py)
262262
├─ ~go → 全流程模式
263263
├─ ~compare → 模型对比(调用 scripts/model_compare_runtime.py 运行时)
264264
└─ 无前缀 → 语义分析
@@ -404,14 +404,16 @@ Next: 请验证功能
404404
~compare # 对同一问题做多模型并发对比(可用模型不足 2 时自动单模型并解释原因)
405405
```
406406

407-
**repo-local runtime helper:**
407+
**runtime helper:**
408408
```
409-
scripts/sopify_runtime.py # 当前仓库默认原始输入入口,直接交给 router 分流
410-
scripts/go_plan_runtime.py # 当前仓库用于 plan-only slice 的 helper
411-
scripts/model_compare_runtime.py # ~compare 的运行时实现,不是默认通用入口
409+
scripts/sopify_runtime.py # 当前仓库默认原始输入入口,直接交给 router 分流
410+
.sopify-runtime/scripts/sopify_runtime.py # 二次接入后 vendored 默认入口
411+
scripts/go_plan_runtime.py # 当前仓库用于 plan-only slice 的 helper
412+
.sopify-runtime/scripts/go_plan_runtime.py # vendored plan-only helper
413+
scripts/model_compare_runtime.py # ~compare 的运行时实现,不是默认通用入口
412414
```
413415

414-
说明:当前默认入口是 `scripts/sopify_runtime.py``scripts/go_plan_runtime.py` 只负责 plan-only;`~compare` 仍依赖宿主侧专用桥接。
416+
说明:当前默认入口是 `scripts/sopify_runtime.py`若以 bundle 方式接入则入口对应 `.sopify-runtime/scripts/sopify_runtime.py``go_plan_runtime.py` 只负责 plan-only;`~compare` 仍依赖宿主侧专用桥接。
415417

416418
**配置文件:** `sopify.config.yaml` (项目根目录)
417419

Claude/Skills/EN/CLAUDE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Complex Task (full 3 phases):
133133
| `~go exec` | Execute existing plan |
134134
| `~compare` | Multi-model parallel comparison (includes session default model by default; falls back with reasons when usable model count is below 2) |
135135

136-
Note: when the current repository provides `scripts/sopify_runtime.py`, raw input should prefer that default repo-local runtime entry; use `scripts/go_plan_runtime.py` only when you explicitly want the plan-only path.
136+
Note: when the current repository provides `scripts/sopify_runtime.py`, raw input should prefer that default repo-local runtime entry; when the runtime is vendored into another repository, prefer `.sopify-runtime/scripts/sopify_runtime.py`; use the matching `go_plan_runtime.py` helper only when you explicitly want the plan-only path.
137137

138138
**workflow-learning proactive capture policy:**
139139
```yaml
@@ -258,7 +258,7 @@ User Input
258258
Check command prefix (~go, ~go plan, ~go exec, ~compare)
259259
260260
├─ ~go exec → Execute existing plan
261-
├─ ~go plan → Plan mode (Analysis → Design; prefer scripts/sopify_runtime.py for raw input, and use scripts/go_plan_runtime.py only for the plan-only slice)
261+
├─ ~go plan → Plan mode (Analysis → Design; prefer scripts/sopify_runtime.py or .sopify-runtime/scripts/sopify_runtime.py for raw input, and use the matching go_plan_runtime.py only for the plan-only slice)
262262
├─ ~go → Full workflow mode
263263
├─ ~compare → Model compare (wired to scripts/model_compare_runtime.py runtime)
264264
└─ No prefix → Semantic analysis
@@ -404,14 +404,16 @@ Next: Please verify the functionality
404404
~compare # Compare one prompt across models (fallbacks below 2 usable models with explicit reasons)
405405
```
406406

407-
**Repo-local runtime helpers:**
407+
**Runtime helpers:**
408408
```
409-
scripts/sopify_runtime.py # default repo-local raw-input entry, routed by the runtime router
410-
scripts/go_plan_runtime.py # helper for the plan-only slice
411-
scripts/model_compare_runtime.py # runtime implementation for ~compare, not the default generic entry
409+
scripts/sopify_runtime.py # default repo-local raw-input entry, routed by the runtime router
410+
.sopify-runtime/scripts/sopify_runtime.py # default vendored raw-input entry after secondary integration
411+
scripts/go_plan_runtime.py # helper for the plan-only slice
412+
.sopify-runtime/scripts/go_plan_runtime.py # vendored helper for the plan-only slice
413+
scripts/model_compare_runtime.py # runtime implementation for ~compare, not the default generic entry
412414
```
413415

414-
Note: the default entry is `scripts/sopify_runtime.py`; `scripts/go_plan_runtime.py` is only for plan-only; `~compare` still depends on a host-side dedicated bridge.
416+
Note: the default entry is `scripts/sopify_runtime.py`; when vendored, the entry becomes `.sopify-runtime/scripts/sopify_runtime.py`; `go_plan_runtime.py` is only for plan-only; `~compare` still depends on a host-side dedicated bridge.
415417

416418
**Configuration File:** `sopify.config.yaml` (project root)
417419

Codex/Skills/CN/AGENTS.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Next: {下一步提示}
133133
| `~go exec` | 执行已有方案 |
134134
| `~compare` | 多模型并发对比(默认含当前会话模型;可用模型数不足 2 时降级并给出原因) |
135135

136-
说明:当前仓库若存在 `scripts/sopify_runtime.py`,原始输入应优先走该默认 repo-local runtime 入口;仅在明确只走 `~go plan` 时使用 `scripts/go_plan_runtime.py` 这个 plan-only helper。
136+
说明:当前仓库若存在 `scripts/sopify_runtime.py`,原始输入应优先走该默认 repo-local runtime 入口;若 runtime 以 bundle 方式接入到其他仓库,则优先走 `.sopify-runtime/scripts/sopify_runtime.py`仅在明确只走 `~go plan` 时使用对应的 `go_plan_runtime.py` helper。
137137

138138
**workflow-learning 主动记录策略:**
139139
```yaml
@@ -258,7 +258,7 @@ progressive: 按需创建文件 (默认)
258258
检查命令前缀 (~go, ~go plan, ~go exec, ~compare)
259259
260260
├─ ~go exec → 执行已有方案
261-
├─ ~go plan → 规划模式 (需求分析 → 方案设计;若存在 scripts/sopify_runtime.py 则原始输入优先走该默认入口,plan-only 场景再使用 scripts/go_plan_runtime.py)
261+
├─ ~go plan → 规划模式 (需求分析 → 方案设计;若存在 scripts/sopify_runtime.py 或 .sopify-runtime/scripts/sopify_runtime.py,则原始输入优先走默认入口,plan-only 场景再使用对应的 go_plan_runtime.py)
262262
├─ ~go → 全流程模式
263263
├─ ~compare → 模型对比(调用 scripts/model_compare_runtime.py 运行时)
264264
└─ 无前缀 → 语义分析
@@ -404,14 +404,16 @@ Next: 请验证功能
404404
~compare # 对同一问题做多模型并发对比(可用模型不足 2 时自动单模型并解释原因)
405405
```
406406

407-
**repo-local runtime helper:**
407+
**runtime helper:**
408408
```
409-
scripts/sopify_runtime.py # 当前仓库默认原始输入入口,直接交给 router 分流
410-
scripts/go_plan_runtime.py # 当前仓库用于 plan-only slice 的 helper
411-
scripts/model_compare_runtime.py # ~compare 的运行时实现,不是默认通用入口
409+
scripts/sopify_runtime.py # 当前仓库默认原始输入入口,直接交给 router 分流
410+
.sopify-runtime/scripts/sopify_runtime.py # 二次接入后 vendored 默认入口
411+
scripts/go_plan_runtime.py # 当前仓库用于 plan-only slice 的 helper
412+
.sopify-runtime/scripts/go_plan_runtime.py # vendored plan-only helper
413+
scripts/model_compare_runtime.py # ~compare 的运行时实现,不是默认通用入口
412414
```
413415

414-
说明:当前默认入口是 `scripts/sopify_runtime.py``scripts/go_plan_runtime.py` 只负责 plan-only;`~compare` 仍依赖宿主侧专用桥接。
416+
说明:当前默认入口是 `scripts/sopify_runtime.py`若以 bundle 方式接入则入口对应 `.sopify-runtime/scripts/sopify_runtime.py``go_plan_runtime.py` 只负责 plan-only;`~compare` 仍依赖宿主侧专用桥接。
415417

416418
**配置文件:** `sopify.config.yaml` (项目根目录)
417419

Codex/Skills/EN/AGENTS.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Complex Task (full 3 phases):
133133
| `~go exec` | Execute existing plan |
134134
| `~compare` | Multi-model parallel comparison (includes session default model by default; falls back with reasons when usable model count is below 2) |
135135

136-
Note: when the current repository provides `scripts/sopify_runtime.py`, raw input should prefer that default repo-local runtime entry; use `scripts/go_plan_runtime.py` only when you explicitly want the plan-only path.
136+
Note: when the current repository provides `scripts/sopify_runtime.py`, raw input should prefer that default repo-local runtime entry; when the runtime is vendored into another repository, prefer `.sopify-runtime/scripts/sopify_runtime.py`; use the matching `go_plan_runtime.py` helper only when you explicitly want the plan-only path.
137137

138138
**workflow-learning proactive capture policy:**
139139
```yaml
@@ -258,7 +258,7 @@ User Input
258258
Check command prefix (~go, ~go plan, ~go exec, ~compare)
259259
260260
├─ ~go exec → Execute existing plan
261-
├─ ~go plan → Plan mode (Analysis → Design; prefer scripts/sopify_runtime.py for raw input, and use scripts/go_plan_runtime.py only for the plan-only slice)
261+
├─ ~go plan → Plan mode (Analysis → Design; prefer scripts/sopify_runtime.py or .sopify-runtime/scripts/sopify_runtime.py for raw input, and use the matching go_plan_runtime.py only for the plan-only slice)
262262
├─ ~go → Full workflow mode
263263
├─ ~compare → Model compare (wired to scripts/model_compare_runtime.py runtime)
264264
└─ No prefix → Semantic analysis
@@ -404,14 +404,16 @@ Next: Please verify the functionality
404404
~compare # Compare one prompt across models (fallbacks below 2 usable models with explicit reasons)
405405
```
406406

407-
**Repo-local runtime helpers:**
407+
**Runtime helpers:**
408408
```
409-
scripts/sopify_runtime.py # default repo-local raw-input entry, routed by the runtime router
410-
scripts/go_plan_runtime.py # helper for the plan-only slice
411-
scripts/model_compare_runtime.py # runtime implementation for ~compare, not the default generic entry
409+
scripts/sopify_runtime.py # default repo-local raw-input entry, routed by the runtime router
410+
.sopify-runtime/scripts/sopify_runtime.py # default vendored raw-input entry after secondary integration
411+
scripts/go_plan_runtime.py # helper for the plan-only slice
412+
.sopify-runtime/scripts/go_plan_runtime.py # vendored helper for the plan-only slice
413+
scripts/model_compare_runtime.py # runtime implementation for ~compare, not the default generic entry
412414
```
413415

414-
Note: the default entry is `scripts/sopify_runtime.py`; `scripts/go_plan_runtime.py` is only for plan-only; `~compare` still depends on a host-side dedicated bridge.
416+
Note: the default entry is `scripts/sopify_runtime.py`; when vendored, the entry becomes `.sopify-runtime/scripts/sopify_runtime.py`; `go_plan_runtime.py` is only for plan-only; `~compare` still depends on a host-side dedicated bridge.
415417

416418
**Configuration File:** `sopify.config.yaml` (project root)
417419

0 commit comments

Comments
 (0)