Skip to content

Commit 4493ce5

Browse files
committed
refactor(runtime): remove legacy compare and consult override
Context-Checkpoint: B Release-Sync: yes Release-Version: 2026-04-29.182018 Release-Date: 2026-04-29
1 parent dc42539 commit 4493ce5

49 files changed

Lines changed: 199 additions & 3085 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,55 @@
11
# Design: Legacy Feature Cleanup
22

3-
> **定位**`20260424_lightweight_pluggable_architecture` 总纲的独立清理包
4-
> **前置**`20260428_action_proposal_boundary` P0 thin slice 已完成,ActionProposal validator 作为正式保护层替代了 legacy keyword classifier
5-
> **目标**:清除被 ActionProposal 替代的 legacy 代码路径和已废弃的 `~compare` 功能模块,降低维护面
3+
> **定位**`20260424_lightweight_pluggable_architecture` 总纲下的独立清理包
4+
> **前置**`20260428_action_proposal_boundary` P0 thin slice 已完成,ActionProposal validator 已成为正式保护层
5+
> **结果**:清除被 ActionProposal 替代的 legacy consult override 路径,并移除已废弃的 model compare 功能面
66
77
---
88

9-
## 范围
9+
## 执行结果
1010

11-
### 1. `explain_only_override` 删除
11+
### 1. Legacy consult override 清理
1212

13-
**现状**
14-
- 两个 callsite:
15-
- `router.py` classify chain(`_classify_explain_only_override`
16-
- `engine.py` plan materialization bypass(`plan_package_policy == "confirm"` 时跳过物化)
17-
- 5 个测试:3 in `test_runtime_router.py`、2 in `test_runtime_sample_invariant_gate.py`
18-
- ActionProposal pre-route interceptor 在 `explain_only_override` 之前就已拦截 `consult_readonly` 请求,使其成为 dead code(对新 host)
13+
已删除内容:
1914

20-
**删除策略**
21-
1. 删除 `router.py``_classify_explain_only_override` 函数及其在 classify chain 的调用
22-
2. 删除 `engine.py` 中对应的 plan materialization bypass 分支
23-
3. 删除 5 个关联测试
24-
4. 确认不影响 `analysis_only_no_write_brake`(保留,作为信号层)
15+
- `runtime/router.py` 中的 explain-only override classifier 与 classify chain callsite
16+
- `runtime/engine.py` 中只服务该 legacy route 的 plan materialization bypass
17+
- 关联的 router / sample invariant / engine 测试断言
2518

26-
**风险**:中等。engine.py callsite 有独立刹车逻辑(`plan_package_policy == "confirm"`),删除前需确认该分支仅服务于 explain_only_override 路由。
19+
保留内容:
2720

28-
### 2. `~compare` 模块移除
21+
- `analysis_only_no_write_brake` 继续作为信号层保留
22+
- `_is_consultation()` 与其他共享 helper 不在本包调整
23+
- legacy host 迁移风险不再额外补安全网;当前线上使用方已升级 ActionProposal path
2924

30-
**现状**
31-
- `scripts/model_compare_runtime.py`~1015 行
32-
- `runtime/compare_decision.py`~179 行
33-
- router.py 中 13 处引用、engine.py 中 10 处引用、gate.py 1 处引用
34-
- 提示层(Codex/SKILL.md 等)中的 `~compare` 命令定义
35-
- cross-review 已作为独立验证/对比方案替代 `~compare` 的核心场景
25+
### 2. Model compare 功能面移除
3626

37-
**删除策略**
38-
1. 删除 `scripts/model_compare_runtime.py``runtime/compare_decision.py`
39-
2. 清理 router.py / engine.py / gate.py 中所有 `~compare` 路由和引用
40-
3. 清理提示层中 `~compare` 命令定义和文档
41-
4. 清理 `sopify.config.yaml` 模板中 `multi_model.*` 配置项
42-
5. 删除关联测试
27+
已删除内容:
4328

44-
**风险**:低-中。删除面广(~1200 行 + 引用),但都是独立模块,无共享依赖。
29+
- `scripts/model_compare_runtime.py`
30+
- `runtime/compare_decision.py`
31+
- `runtime/builtin_skill_packages/model-compare/skill.yaml`
32+
- Codex / Claude 双语 `model-compare` 子 Skill 文档
33+
34+
已清理引用:
35+
36+
- router / engine / gate / handoff / output / replay / manifest / builtin catalog
37+
- runtime config 中的 `multi_model` 字段、默认值与校验
38+
- README、Codex / Claude host prompt、design-rules 中的命令与配置说明
39+
- eval gate、SLO、baseline 与同步脚本中的 compare 专项入口
40+
- 对应测试改为验证功能已移除或删除旧行为断言
4541

4642
---
4743

48-
## 执行顺序
44+
## 当前行为
4945

50-
1. `explain_only_override` 先行(blast radius 更小,验证删除流程)
51-
2. `~compare` 后续(文件量大但逻辑独立)
52-
3. 每步后跑全量测试确认无回归
46+
- `~go``~go plan``~go exec``~go finalize` 仍是命令前缀入口。
47+
- `~compare` 不再是命令前缀;输入会按普通文本进入现有路由。
48+
- `multi_model.*` 不再是 runtime config 字段。
49+
- 内置 Skill manifest 不再包含 `model-compare`
5350

5451
## 不做
5552

56-
- 不删除 `analysis_only_no_write_brake`(保留作为信号层)
57-
- 不动 `_is_consultation()` 或其他共享 helper
58-
- 不做 prompt governance(独立方案包)
53+
- 不引入 CrossReview 替代口径。
54+
- 不做 prompt governance;该议题已放入独立 follow-up。
55+
- 不归档本方案包;本次只完成清理与文档收口,归档可在最终确认后处理。

.sopify-skills/plan/20260429_legacy_feature_cleanup/tasks.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,38 @@
22

33
## 任务列表
44

5-
### T1: explain_only_override 删除
6-
7-
- [ ] T1-A: 审计 `router.py``_classify_explain_only_override` 完整调用链
8-
- [ ] T1-B: 审计 `engine.py` 中 plan materialization bypass 分支的独立性
9-
- [ ] T1-C: 删除 router.py callsite + 函数
10-
- [ ] T1-D: 删除 engine.py callsite
11-
- [ ] T1-E: 删除 5 个关联测试
12-
- [ ] T1-F: 跑全量测试确认无回归
13-
14-
### T2: ~compare 模块移除
15-
16-
- [ ] T2-A: 列出所有 `~compare` / `model_compare` / `compare_decision` 引用(代码 + 提示 + 配置)
17-
- [ ] T2-B: 删除 `scripts/model_compare_runtime.py`
18-
- [ ] T2-C: 删除 `runtime/compare_decision.py`
19-
- [ ] T2-D: 清理 router.py / engine.py / gate.py 引用
20-
- [ ] T2-E: 清理提示层 `~compare` 命令定义
21-
- [ ] T2-F: 清理 `multi_model.*` 配置项模板
22-
- [ ] T2-G: 删除关联测试
23-
- [ ] T2-H: 跑全量测试确认无回归
24-
25-
### T3: 收口
26-
27-
- [ ] T3-A: 更新 blueprint README 焦点
28-
- [ ] T3-B: 更新总纲 tasks.md 状态
29-
- [ ] T3-C: 归档至 history
30-
31-
## 依赖关系
32-
33-
```
34-
T1-A, T1-B → T1-C, T1-D → T1-E → T1-F
35-
T2-A → T2-B~T2-G → T2-H
36-
T1-F, T2-H → T3
37-
```
5+
### T1: legacy consult override 删除
6+
7+
- [x] T1-A: 审计 router 中的 legacy consult override 调用链
8+
- [x] T1-B: 审计 engine 中 plan materialization bypass 分支的独立性
9+
- [x] T1-C: 删除 router callsite 与 classifier
10+
- [x] T1-D: 删除 engine callsite
11+
- [x] T1-E: 删除或改写关联测试
12+
- [x] T1-F: 保留 `analysis_only_no_write_brake` 与共享 helper
13+
14+
### T2: model compare 功能面移除
15+
16+
- [x] T2-A: 列出所有 compare runtime / decision / prompt / config 引用
17+
- [x] T2-B: 删除 model compare runtime helper
18+
- [x] T2-C: 删除 compare decision helper
19+
- [x] T2-D: 清理 router / engine / gate / handoff / output / replay / manifest 引用
20+
- [x] T2-E: 删除内置 model-compare skill package 与双语子 Skill 文档
21+
- [x] T2-F: 清理 host prompt、README、design-rules 中的命令与配置说明
22+
- [x] T2-G: 清理 `multi_model` runtime config 字段、默认值与校验
23+
- [x] T2-H: 更新 eval gate、SLO、baseline 与同步脚本
24+
- [x] T2-I: 删除旧行为断言,保留已移除行为的 guard 测试
25+
26+
### T3: 验证与收口
27+
28+
- [x] T3-A: 运行残留引用扫描
29+
- [x] T3-B: 运行 compileall
30+
- [x] T3-C: 运行聚焦测试
31+
- [x] T3-D: 运行 git diff --check
32+
- [x] T3-E: 运行全量测试
33+
- [ ] T3-F: 最终确认后再决定是否归档本方案包
34+
35+
## 收口说明
36+
37+
- 本包不补 CrossReview 替代口径。
38+
- 本包不展开 prompt governance。
39+
- `.sopify-skills/blueprint/design.md``20260429_host_prompt_governance` 中的并行编辑由用户保留,本包不覆盖。

CHANGELOG.md

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

77
## [Unreleased]
88

9+
## [2026-04-29.182018] - 2026-04-29
10+
11+
### Docs
12+
13+
- Refined public documentation:
14+
- `README.md`
15+
- `README.zh-CN.md`
16+
17+
### Runtime
18+
19+
- Updated runtime internals:
20+
- `runtime/_models/core.py`
21+
- `runtime/builtin_catalog.generated.json`
22+
- `runtime/builtin_catalog.py`
23+
- `runtime/builtin_skill_packages/model-compare/skill.yaml`
24+
- `runtime/checkpoint_request.py`
25+
- `runtime/compare_decision.py`
26+
- `runtime/config.py`
27+
- `runtime/engine.py`
28+
- `runtime/gate.py`
29+
- `runtime/handoff.py`
30+
- `runtime/manifest.py`
31+
- `runtime/output.py`
32+
- `runtime/replay.py`
33+
- `runtime/router.py`
34+
35+
### Scripts
36+
37+
- Adjusted maintenance scripts:
38+
- `scripts/check-skill-eval-gate.py`
39+
- `scripts/model_compare_runtime.py`
40+
- `scripts/sync-runtime-assets.sh`
41+
42+
### Skills
43+
44+
- Synced prompt-layer skills:
45+
- `Claude/Skills/CN/CLAUDE.md`
46+
- `Claude/Skills/CN/skills/sopify/design/references/design-rules.md`
47+
- `Claude/Skills/CN/skills/sopify/model-compare/SKILL.md`
48+
- `Claude/Skills/EN/CLAUDE.md`
49+
- `Claude/Skills/EN/skills/sopify/design/references/design-rules.md`
50+
- `Claude/Skills/EN/skills/sopify/model-compare/SKILL.md`
51+
- `Codex/Skills/CN/AGENTS.md`
52+
- `Codex/Skills/CN/skills/sopify/design/references/design-rules.md`
53+
- `Codex/Skills/CN/skills/sopify/model-compare/SKILL.md`
54+
- `Codex/Skills/EN/AGENTS.md`
55+
- `Codex/Skills/EN/skills/sopify/design/references/design-rules.md`
56+
- `Codex/Skills/EN/skills/sopify/model-compare/SKILL.md`
57+
58+
### Tests
59+
60+
- Updated automated coverage:
61+
- `tests/fixtures/sample_invariant_gate_matrix.yaml`
62+
- `tests/runtime_test_support.py`
63+
- `tests/test_action_intent.py`
64+
- `tests/test_bundle_smoke.py`
65+
- `tests/test_runtime_config.py`
66+
- `tests/test_runtime_decision.py`
67+
- `tests/test_runtime_engine.py`
68+
- `tests/test_runtime_gate.py`
69+
- `tests/test_runtime_router.py`
70+
- `tests/test_runtime_sample_invariant_gate.py`
71+
- `tests/test_runtime_skill_registry.py`
72+
73+
### Changed
74+
75+
- Updated project files:
76+
- `evals/skill_eval_baseline.json`
77+
- `evals/skill_eval_slo.json`
78+
- `examples/sopify.config.yaml`
79+
- `installer/bootstrap_workspace.py`
80+
981
## [2026-04-29.150302] - 2026-04-29
1082

1183
### Docs

0 commit comments

Comments
 (0)