Skip to content

Commit 9063631

Browse files
authored
Merge pull request #20 from evidentloop/feat/blueprint-truth-cutover
Blueprint Truth Cutover: Wave 1-3b + 验收收口
2 parents 5430c9e + 4d8463c commit 9063631

83 files changed

Lines changed: 1409 additions & 5487 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ is_release_relevant_file() {
9292
runtime/*|installer/*|Codex/Skills/*|Claude/Skills/*|README.md|README.zh-CN.md|CHANGELOG.md)
9393
return 0
9494
;;
95-
scripts/sopify_runtime.py|scripts/go_plan_runtime.py|scripts/model_compare_runtime.py|scripts/clarification_bridge_runtime.py|scripts/decision_bridge_runtime.py|scripts/develop_checkpoint_runtime.py|scripts/sync-runtime-assets.sh|scripts/check-runtime-smoke.sh|scripts/release-sync.sh|scripts/release-preflight.sh|scripts/sync-skills.sh|scripts/check-skills-sync.sh|scripts/check-version-consistency.sh)
95+
scripts/sopify_runtime.py|scripts/go_plan_runtime.py|scripts/model_compare_runtime.py|scripts/clarification_bridge_runtime.py|scripts/decision_bridge_runtime.py|scripts/develop_callback_runtime.py|scripts/sync-runtime-assets.sh|scripts/check-runtime-smoke.sh|scripts/release-sync.sh|scripts/release-preflight.sh|scripts/sync-skills.sh|scripts/check-skills-sync.sh|scripts/check-version-consistency.sh)
9696
return 0
9797
;;
9898
*)

.sopify-skills/blueprint/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<!-- sopify:auto:focus:start -->
1616
- 当前活动 plan:暂无。
17-
- history 归档:已可用;最近归档为 `../history/2026-05/20260501_convention_smoke`
17+
- history 归档:已可用;最近归档为 `../history/2026-04/20260429_standard-archive-finalize-archive-checkpoint`
1818
<!-- sopify:auto:focus:end -->
1919

2020
## 深入阅读入口
@@ -27,5 +27,5 @@
2727
- [Sopify 最小协议规范 (Protocol v0)](./protocol.md)
2828
- [Skill 标准对齐蓝图](./skill-standards-refactor.md)
2929
- [变更历史](../history/index.md)
30-
- 最近归档:`../history/2026-05/20260501_convention_smoke`
30+
- 最近归档:`../history/2026-04/20260429_standard-archive-finalize-archive-checkpoint`
3131
<!-- sopify:auto:read-next:end -->

.sopify-skills/blueprint/architecture-decision-records/ADR-017.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Implementation plan 可补充字段,但不得删除或弱化上述字段的 fa
6060
|--------|--------|------|
6161
| `clarification` | **保留为 canonical checkpoint** | 补事实是真协作分叉 |
6262
| `decision` | **保留为 canonical checkpoint** | 拍板选路是真协作分叉 |
63-
| `plan_proposal` | propose_plan pending artifact | 等 side-effect proof 稳定后降级 |
63+
| `plan_proposal` | propose_plan pending artifact | ~~等 side-effect proof 稳定后降级~~ **Wave 3a 已 hard-cut 删除** |
6464
| `execution_confirm` | ExecutionAuthorizationReceipt | 授权不是协作分叉 |
6565
| `develop_checkpoint` | develop callback source | 触发 clarification/decision,不是独立类型 |
6666

.sopify-skills/blueprint/design.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
## 产品定位 (ADR-013)
66

7-
Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。它不负责生成代码或编排 agent,而是把外部生产、验证、知识工具的结果收敛成可恢复、可审计、可授权的机器事实。Sopify 官方在 core 之上提供一个轻量、可插拔、收敛式的 blueprint-driven workflow 作为默认产品体验
7+
Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。它不负责生成代码或编排 agent,而是把外部生产、验证、知识工具的结果收敛成可恢复、可审计、可授权的机器事实。Sopify 官方在 core 之上提供一个轻量、可插拔、收敛式的 workflow,并以 blueprint 作为默认的长期知识基线
88

99
| 层级 | 表述 |
1010
|------|------|
1111
| 用户层 | 任务可恢复、决策可追踪、产出质量可验证,跨宿主无缝接力 |
12-
| 产品层 | Core: 证据规范 + 授权判定 + 收据 + 接力 + archive truth;Default Workflow: blueprint 驱动的收敛式工作流 |
13-
| 架构层 | Evidence & authorization layer + official blueprint-driven workflow on top |
12+
| 产品层 | Core: 证据规范 + 授权判定 + 收据 + 接力 + archive truth;Default Workflow: blueprint 为基线的收敛式工作流 |
13+
| 架构层 | Evidence & authorization layer + official workflow anchored on blueprint as long-term knowledge baseline |
1414

1515
## 产品分层
1616

1717
| 产品层 | 职责 | 映射到实现 |
1818
|-------|------|-----------|
1919
| **Core** | 证据规范、授权判定、收据生成、handoff 接力、archive truth | Protocol + Validator |
20-
| **Default Workflow** | blueprint 驱动分析、标准方案包生成、checkpoint 讨论(含跨宿主审查)、归档回写 | Protocol conventions + Validator policies + 可选 Runtime 编排 |
20+
| **Default Workflow** | blueprint 为基线的分析、标准方案包生成、checkpoint 讨论(含跨宿主审查)、归档回写 | Protocol conventions + Validator policies + 可选 Runtime 编排 |
2121
| **Plugins / Skills** | 生产增强、验证增强、知识增强(cross-review, graphify 等) | Integration Contract (protocol.md §6) + Validator admission |
2222

2323
**层间规则:**
@@ -100,6 +100,8 @@ Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。
100100

101101
> **迁移现状(2026-05)**:Protocol-first 是已确认的架构方向。`blueprint/protocol.md` v0 已落地,定义了不依赖 runtime 也成立的最小可携带协议。当前 runtime(~29K 行 / 66 模块)仍是最完整的参考实现,protocol.md 是协议层的规范起点。
102102
>
103+
> **Blueprint Truth Cutover 原则**:Blueprint 是产品合法边界和预算的唯一定义源。Runtime 定义 how it currently runs,blueprint 定义 what is valid。当 runtime 与 blueprint 冲突时,以 blueprint 为准——runtime 中超出 canonical 预算的面是待迁移的遗留面,不是产品真相。Runtime 在架构上是参考实现和迁移层,不是 truth source。当前产品尚处于早期阶段,无外部消费者依赖和生产级兼容承诺,处于可激进收敛的窗口期。
104+
>
103105
> **协议规范**`blueprint/protocol.md` 定义最小可携带协议(目录结构、必备文件/字段、宿主最小义务、生命周期样例)。本节定义三层架构分工,protocol.md 定义最小合规下界。
104106
105107
|| 内容 | 体量目标 | 可替代性 |
@@ -185,7 +187,7 @@ Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。
185187

186188
| 旧类型 | 新定位 | 说明 |
187189
|--------|--------|------|
188-
| `plan_proposal` | propose_plan 的 pending artifact | 等 ActionProposal side-effect proof 稳定后降级 |
190+
| `plan_proposal` | ~~propose_plan 的 pending artifact~~ | **Wave 3a 已 hard-cut 删除** |
189191
| `execution_confirm` | ExecutionAuthorizationReceipt | 机器授权事实,不是协作分叉 |
190192
| `develop_checkpoint` | develop callback source | 可触发 clarification 或 decision,不是独立 checkpoint type |
191193

@@ -203,7 +205,7 @@ Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。
203205

204206
| Legacy action | 目标归宿 | Sunset 条件 |
205207
|---------------|----------|------------|
206-
| `confirm_plan_package` | propose_plan artifact flow | ActionProposal side-effect proof 覆盖 |
208+
| `confirm_plan_package` | ~~propose_plan artifact flow~~ | **Wave 3a 已 hard-cut 删除** |
207209
| `confirm_execute` | ExecutionAuthorizationReceipt | receipt 替代 checkpoint |
208210
| `review_or_execute_plan` | ActionProposal routing | Validator 接管 |
209211
| `continue_host_quick_fix` | `continue_host_develop(mode=quick_fix)` | 合并为 hint |
@@ -214,16 +216,30 @@ Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。
214216

215217
#### Route Families (target: 6)
216218

217-
| Canonical | 覆盖旧 route |
218-
|-----------|-------------|
219-
| `plan` | workflow, light_iterate, plan_only |
220-
| `develop` | quick_fix, exec_plan, resume_active |
221-
| `consult` | consult_readonly |
222-
| `archive` | archive |
223-
| `clarification` | clarification_pending, clarification_resume |
224-
| `decision` | decision_pending, decision_resume |
219+
| Canonical | 覆盖 route_name(runtime 实际值) |
220+
|-----------|-------------------------------|
221+
| `plan` | `plan_only`, `workflow`, `light_iterate` |
222+
| `develop` | `exec_plan`, `resume_active`, `quick_fix` |
223+
| `consult` | `consult`, `replay` |
224+
| `archive` | `archive_lifecycle` |
225+
| `clarification` | `clarification_pending`, `clarification_resume` |
226+
| `decision` | `decision_pending`, `decision_resume` |
227+
228+
#### Non-family Surfaces
229+
230+
以下 route 不计入 6 family 预算。总条件:它不是 resumable 的 host-facing workflow continuation。然后必须属于以下之一:
231+
232+
1. **跨路由错误面** — 任何 route 内均可触发的横切 error handling
233+
2. **显式 control/teardown 命令** — 不产出 handoff、不参与工作流推进
234+
3. **显式 read-only utility 命令** — 不影响工作流状态的只读渲染
235+
236+
| route_name | 分类 | 说明 |
237+
|------------|------|------|
238+
| `state_conflict` | 跨路由错误面 | state-resolution error surface |
239+
| `cancel_active` | control/teardown | 清空 active flow,不产出 handoff |
240+
| `summary` | read-only utility | `~summary` 显式命令,不写 last_route、不覆盖 handoff |
225241

226-
`resolve_state_conflict` 是 state-resolution error surface,不计入 workflow route family。它在任何 route 内均可触发,作为横切 error handling 存在
242+
新增 non-family surface 必须显式修改本段落,默认不允许扩口。non-family surface 如果不再被 runtime 主链路引用,应直接删除而非保留为 legacy
227243

228244
#### Core State Files (target: 6, authoritative)
229245

@@ -236,7 +252,7 @@ Sopify 的 durable core 是跨宿主 AI 工作流的 **证据与授权层**。
236252
| `current_decision.json` | decision checkpoint |
237253
| `current_archive_receipt.json` | archive 可审计 receipt(不是 host action) |
238254

239-
**Fold/remove:** `current_plan_proposal.json``current_handoff.artifacts.proposal``current_run` pending artifact。不得新建替代文件。
255+
**Fold/remove:** ~~`current_plan_proposal.json`~~**Wave 3a 已删除,未新建替代文件。`context_snapshot.current_plan_proposal` 字段保留为 `None`(反序列化兼容)。**
240256

241257
**Derived/compat(不计入 core budget):** `last_route.json` — 后续证明可从 handoff/run 派生后移除。
242258

@@ -292,7 +308,7 @@ Sopify 的设计目标不仅是工程轻量(削减 runtime),更是产品
292308

293309
**Decision:** 多方案拍板。Runtime 写入 `current_decision.json`,handoff 暴露推荐项与提交状态。宿主展示选项,等待确认后恢复 runtime。Pending 期间不物化 plan。
294310

295-
**Develop callback:** `continue_host_develop` 期间命中用户拍板分叉时,通过 `develop_checkpoint_runtime.py` 回调 runtime,触发 clarification 或 decision。不是独立 checkpoint type。
311+
**Develop callback:** `continue_host_develop` 期间命中用户拍板分叉时,通过 `develop_callback_runtime.py` 回调 runtime,触发 clarification 或 decision。不是独立 checkpoint type。
296312

297313
### knowledge_sync
298314

@@ -319,7 +335,7 @@ knowledge_sync:
319335
### Runtime state scope
320336

321337
- Review state 默认落在 `state/sessions/<session_id>/`,覆盖 `current_plan/current_run/current_handoff/current_clarification/current_decision/last_route`
322-
- 根级 `state/` 只承载 global execution truth(当前仍包含 `execution_confirm_pending / resume_active / exec_plan` 等 transitional 语义,将随 ExecutionAuthorizationReceipt 和 route 收敛逐步清理)
338+
- 根级 `state/` 只承载 global execution truth(当前仍包含 `resume_active / exec_plan` 等 transitional 语义,将随 route 收敛逐步清理;`execution_confirm_pending` 已在 Wave 3b 删除
323339
- Archive lifecycle 只在归档主体等于当前 global `current_plan` 时清理对应执行状态
324340
- `session_id` 由宿主透传或 gate 自动生成;同一条 review 续轮必须复用同一个 `session_id`
325341
- 并发 review 使用不同 `session_id`;global truth 只补 soft ownership 观测字段

.sopify-skills/blueprint/skill-standards-refactor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ host_support:
207207
1. 命中 `plan/design/develop/decision/checkpoint/handoff` 任一流程语义
208208
2. 命中 `~go/~go plan/~go exec/~go finalize/~compare` 任一命令语义
209209
3. 变更目标位于 `.sopify-skills/plan/*` 的结构化任务资产
210-
4. 任何 `required_host_action` 处于 pending 三态(`answer_questions/confirm_decision/confirm_execute`)
210+
4. 任何 `required_host_action` 处于 pending 二态(`answer_questions/confirm_decision`)
211211

212212
### 咨询问答边界
213213

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Blueprint Truth Cutover — 背景
2+
3+
## 需求背景
4+
5+
Sopify 的架构方向已确认为 Protocol-first / Runtime-optional(ADR-016),蓝图骨架已稳定:
6+
7+
- 产品分层:Core / Default Workflow / Plugins
8+
- 架构分层:Protocol / Validator / Runtime
9+
- 削减预算:checkpoint 2、host action 5、route family 6、core state 6
10+
11+
但当前 runtime(~29K 行 / 66 模块)仍远超蓝图预算:checkpoint 5 种、host action 13 种、route 18 种、state 文件 8 个。协议层膨胀与轻量化方向正面冲突。
12+
13+
## 核心矛盾
14+
15+
方向已经定了,但 runtime 仍然在代表过去。
16+
17+
旧 P1–P4 路线图默认 runtime 仍是产品主体,在旧面上做收缩治理。这是最贵的路径:蓝图越写越好,runtime 却继续按旧惯性生长,两边渐行渐远。
18+
19+
## 为什么现在做
20+
21+
1. **产品尚处于早期阶段** — 无外部消费者依赖和生产级兼容承诺,兼容约束最小
22+
2. **蓝图骨架已够稳定** — Core / Default Workflow / Plugins 分层、Protocol / Validator / Runtime 分层、削减预算均已硬写在 design.md,不需要等 draft 细节全部定型
23+
3. **窗口成本极低** — 破坏旧兼容、删旧入口、废弃旧 API 在当前阶段代价趋近于零;越晚做越贵
24+
4. **runtime 每多存在一天,就多固化一天错误形状** — 新功能、新修补继续在旧面上累积,增加未来迁移成本
25+
26+
## 已知局限
27+
28+
- protocol §6 Integration Contract 和 §7 Multi-host review wire contract 仍为 informative/draft,不阻塞 cutover 但限制新链路可证明的深度
29+
- 完整 Validator 实现不在本轮范围
30+
- Runtime 不会一次性降到 <20K 行最终目标
31+
32+
## 方案定位
33+
34+
本方案是 Sopify 当前最高优先级(P0+),高于 blueprint tasks.md 现有 P1–P4。目标是让 blueprint 成为唯一 forward baseline,runtime 降为迁移层/参考实现。不替代 P1–P4,而是重新定义它们的执行语境。

0 commit comments

Comments
 (0)