@xenonbyte/da-vinci-workflow 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +23 -1
  3. package/README.zh-CN.md +23 -1
  4. package/SKILL.md +15 -0
  5. package/commands/claude/dv/design.md +2 -0
  6. package/commands/claude/dv/verify.md +2 -0
  7. package/commands/codex/prompts/dv-design.md +2 -0
  8. package/commands/codex/prompts/dv-verify.md +1 -0
  9. package/commands/gemini/dv/design.toml +2 -0
  10. package/commands/gemini/dv/verify.toml +1 -0
  11. package/docs/mcp-aware-gate-implementation.md +291 -0
  12. package/docs/mcp-aware-gate-tests.md +244 -0
  13. package/docs/mcp-aware-gate.md +246 -0
  14. package/docs/mode-use-cases.md +2 -0
  15. package/docs/prompt-presets/README.md +1 -0
  16. package/docs/prompt-presets/desktop-app.md +4 -0
  17. package/docs/prompt-presets/mobile-app.md +4 -0
  18. package/docs/prompt-presets/tablet-app.md +4 -0
  19. package/docs/prompt-presets/web-app.md +4 -0
  20. package/docs/visual-adapters.md +9 -0
  21. package/docs/visual-assist-presets/README.md +4 -2
  22. package/docs/visual-assist-presets/desktop-app.md +2 -0
  23. package/docs/visual-assist-presets/mobile-app.md +2 -0
  24. package/docs/visual-assist-presets/tablet-app.md +2 -0
  25. package/docs/visual-assist-presets/web-app.md +2 -0
  26. package/docs/workflow-examples.md +9 -4
  27. package/docs/zh-CN/mcp-aware-gate-implementation.md +290 -0
  28. package/docs/zh-CN/mcp-aware-gate-tests.md +244 -0
  29. package/docs/zh-CN/mcp-aware-gate.md +249 -0
  30. package/docs/zh-CN/mode-use-cases.md +3 -0
  31. package/docs/zh-CN/prompt-presets/README.md +1 -0
  32. package/docs/zh-CN/prompt-presets/desktop-app.md +4 -0
  33. package/docs/zh-CN/prompt-presets/mobile-app.md +4 -0
  34. package/docs/zh-CN/prompt-presets/tablet-app.md +4 -0
  35. package/docs/zh-CN/prompt-presets/web-app.md +4 -0
  36. package/docs/zh-CN/visual-adapters.md +9 -0
  37. package/docs/zh-CN/visual-assist-presets/README.md +5 -3
  38. package/docs/zh-CN/visual-assist-presets/desktop-app.md +2 -0
  39. package/docs/zh-CN/visual-assist-presets/mobile-app.md +2 -0
  40. package/docs/zh-CN/visual-assist-presets/tablet-app.md +2 -0
  41. package/docs/zh-CN/visual-assist-presets/web-app.md +2 -0
  42. package/docs/zh-CN/workflow-examples.md +9 -4
  43. package/examples/greenfield-spec-markupflow/DA-VINCI.md +1 -0
  44. package/examples/greenfield-spec-markupflow/README.md +3 -0
  45. package/examples/greenfield-spec-markupflow/design-registry.md +3 -0
  46. package/examples/greenfield-spec-markupflow/pencil-design.md +4 -0
  47. package/lib/audit.js +348 -0
  48. package/lib/cli.js +47 -1
  49. package/lib/mcp-runtime-gate.js +342 -0
  50. package/package.json +3 -2
  51. package/references/artifact-templates.md +35 -3
  52. package/references/checkpoints.md +69 -1
  53. package/references/design-inputs.md +9 -1
  54. package/references/layout-hygiene.md +117 -0
  55. package/references/pencil-design-to-code.md +8 -0
  56. package/scripts/test-mcp-runtime-gate.js +199 -0
@@ -21,6 +21,7 @@ Recommended `DA-VINCI.md` block:
21
21
  - tablet page composition
22
22
  - hierarchy and spacing
23
23
  - touch-aware motion guidance
24
+ - anchor-surface composition
24
25
  - Pencil design refinement
25
26
  - Fallback:
26
27
  - native-da-vinci
@@ -31,6 +32,7 @@ Recommended `DA-VINCI.md` block:
31
32
  Notes:
32
33
 
33
34
  - keep spacing more generous than desktop but more structured than phone UI
35
+ - replace adapter names with the actual installed names for the current environment when they differ
34
36
  - use adapter guidance to improve split layouts, canvases, and workspace balance
35
37
  - avoid over-compressing content into phone-like stacking
36
38
  - if the result still feels bland or over-framed, move `frontend-skill` to the first slot and require a stronger visual thesis before Pencil work
@@ -21,6 +21,7 @@ Recommended `DA-VINCI.md` block:
21
21
  - page composition
22
22
  - hierarchy and spacing
23
23
  - responsive motion guidance
24
+ - anchor-surface composition
24
25
  - Pencil design refinement
25
26
  - Fallback:
26
27
  - native-da-vinci
@@ -31,6 +32,7 @@ Recommended `DA-VINCI.md` block:
31
32
  Notes:
32
33
 
33
34
  - keep `ui-ux-pro-max` first for product surfaces, dashboards, and operational UI
35
+ - replace adapter names with the actual installed names for the current environment when they differ
34
36
  - if the project is more brand-led than tool-led, swap the order and put `frontend-skill` first
35
37
  - do not let responsive polish erase product clarity
36
38
  - if the output feels like generic SaaS filler, switch `frontend-skill` to first and tighten the visual direction in `DA-VINCI.md`
@@ -83,10 +83,13 @@ Expected flow:
83
83
  7. write the visual thesis, content plan, interaction thesis, and structural-delta notes for the anchor surfaces
84
84
  8. create new or updated Pencil pages from fresh composition rather than a recolor of the old UI, preferring persistence under `.da-vinci/designs/`
85
85
  9. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
86
- 10. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
87
- 11. bind routes and pages to Pencil screens
88
- 12. generate tasks aligned to the redesign slices
89
- 13. build and verify
86
+ 10. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
87
+ 11. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
88
+ 12. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
89
+ 13. bind routes and pages to Pencil screens
90
+ 14. generate tasks aligned to the redesign slices
91
+ 15. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
92
+ 16. build and verify only after the completion gate can eventually pass
90
93
 
91
94
  ### Complex Android example
92
95
 
@@ -107,6 +110,8 @@ Do not treat screenshot analysis as an automatic pass if it reports hierarchy, s
107
110
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
108
111
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
109
112
  Keep `.da-vinci/designs/` reserved for `.pen` files only.
113
+ Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
114
+ Do not report completion if the `.pen` source exists only in memory or only as exported PNGs.
110
115
  Do not pass design checkpoint if the result is just a skin-swap of the old UI.
111
116
  ```
112
117
 
@@ -0,0 +1,290 @@
1
+ # MCP-Aware Gate 实现设计
2
+
3
+ 这份文档把 MCP-aware gate 提案收敛成实现设计。
4
+
5
+ 它仍然不是代码实现承诺。
6
+
7
+ ## 范围
8
+
9
+ 这份设计只覆盖第一版最小实现:
10
+
11
+ - runtime source convergence
12
+ - runtime screen presence
13
+ - runtime review execution
14
+ - runtime truth 和 filesystem truth 不一致时阻断完成态
15
+
16
+ 不覆盖:
17
+
18
+ - 自动重建 `.pen`
19
+ - 通过 CLI 读取 live MCP 状态
20
+ - session persistence 或 transport 工程
21
+
22
+ ## 设计目标
23
+
24
+ 增加一个很窄的 runtime checkpoint,用来阻断 live editor 漂移造成的假完成态。
25
+
26
+ 它应该能抓住这类情况:
27
+
28
+ - active editor 仍然是 `new`
29
+ - anchor screen 只存在于 live session
30
+ - 截图使用的 node id 在当前 editor 中不存在
31
+ - runtime 状态和 filesystem 状态没收敛时,工作流却声称完成
32
+
33
+ ## 当前架构约束
34
+
35
+ 当前架构已经具备:
36
+
37
+ - filesystem `audit`
38
+ - `references/checkpoints.md` 中的 checkpoint 规则
39
+ - `design-registry.md` 和 `pencil-design.md` 中的工件约束
40
+ - 通过 MCP 读取 active editor 和 live screen 的能力
41
+
42
+ 当前架构还不具备:
43
+
44
+ - 直接从 CLI 读取 MCP runtime state 的能力
45
+ - 脱离当前 agent 上下文的稳定 session id
46
+
47
+ 所以 MCP-aware gate 必须在 agent 工作流里执行,而不是由 CLI 接管。
48
+
49
+ ## 实现挂载点
50
+
51
+ ### 主挂载点
52
+
53
+ 1. 第一次成功写入 Pencil 之后。
54
+ 2. 任何 `design complete` 或 `workflow complete` 声明之前。
55
+
56
+ ### 次挂载点
57
+
58
+ 3. 当设计要从 anchor surface 扩张到更多页面前。
59
+
60
+ ### 原因
61
+
62
+ - 第一次写入后执行:尽早抓到 `new` editor 漂移
63
+ - 完成前执行:阻止假完成
64
+ - 扩张前执行:防止弱 runtime 状态扩散到更多页面
65
+
66
+ ## 归属阶段
67
+
68
+ runtime gate 应该归设计阶段所有,不归 CLI 所有。
69
+
70
+ 也就是说:
71
+
72
+ - design route 在 Pencil MCP 可用时负责执行
73
+ - verify route 在声称设计完成时可以复查
74
+ - build route 不应该成为 runtime gate 的主要执行方
75
+
76
+ ## 输入来源
77
+
78
+ ### MCP 输入
79
+
80
+ 必需:
81
+
82
+ - active editor state
83
+ - top-level nodes
84
+ - 声称完成的 anchor screen 对应节点
85
+
86
+ 预期 MCP 操作:
87
+
88
+ - `pencil.get_editor_state`
89
+ - `pencil.batch_get`
90
+
91
+ ### 文件系统输入
92
+
93
+ 必需:
94
+
95
+ - shell 可见 `.pen`
96
+ - `design-registry.md` 中登记的 `.pen`
97
+ - `pencil-design.md` 中记录的 anchor / review / screenshot target
98
+
99
+ 预期文件读取:
100
+
101
+ - 读取 `design-registry.md`
102
+ - 读取 `pencil-design.md`
103
+ - 检查登记的 `.pen` 是否真实存在
104
+
105
+ ## Runtime Snapshot 模型
106
+
107
+ runtime gate 应先构造一个结构化 snapshot:
108
+
109
+ ```md
110
+ runtime snapshot
111
+ - activeEditor
112
+ - topLevelScreenIds
113
+ - topLevelScreenNames
114
+ - registeredPenPath
115
+ - shellVisiblePenExists
116
+ - claimedAnchorIds
117
+ - claimedReviewedScreenIds
118
+ - reviewTargets
119
+ ```
120
+
121
+ 后续 evaluator 只依赖这份 snapshot。
122
+
123
+ 这样实现就能在没有真实 Pencil session 的情况下做单元测试。
124
+
125
+ ## 评估阶段
126
+
127
+ ### Stage 1: Source Convergence
128
+
129
+ 检查:
130
+
131
+ - active editor 不是 `new`
132
+ - `design-registry.md` 中存在登记的 `.pen`
133
+ - 登记的 `.pen` 在磁盘上真实存在
134
+ - active editor 和登记设计源没有明显分叉
135
+
136
+ 结果规则:
137
+
138
+ - `PASS`:runtime source 和登记 source 已收敛
139
+ - `WARN`:还没产生新的 live edit,或在用已记录的延后 baseline
140
+ - `BLOCK`:runtime source 未命名、缺失,或已经分叉
141
+
142
+ ### Stage 2: Screen Presence
143
+
144
+ 检查:
145
+
146
+ - 声称完成的 anchor id 在 live MCP state 中存在
147
+ - 声称已 review 的 screen 在 live MCP state 中存在
148
+ - screenshot target 在当前文档中可解析
149
+
150
+ 结果规则:
151
+
152
+ - `PASS`:声称完成的设计输出能追溯到 live editor
153
+ - `WARN`:screen 命名有漂移,但仍可恢复映射
154
+ - `BLOCK`:声称完成的 screen 或 target 无法解析
155
+
156
+ ### Stage 3: Review Execution
157
+
158
+ 检查:
159
+
160
+ - 每个已批准 anchor 都存在 reviewed screen id 或 screenshot target
161
+ - runtime review 记录和当前 live editor 对齐
162
+ - review blocker 没有被忽略
163
+
164
+ 结果规则:
165
+
166
+ - `PASS`:runtime review 可信
167
+ - `WARN`:存在 review,但继续扩张前还需要回改
168
+ - `BLOCK`:当前批准结论缺乏 runtime 证据支撑
169
+
170
+ ## 记录策略
171
+
172
+ 不要新增一类全新工件。
173
+
174
+ 应把结果追加到 `pencil-design.md`:
175
+
176
+ ```md
177
+ ## MCP Runtime Gate
178
+ - Time:
179
+ - Active editor:
180
+ - Registered `.pen` path:
181
+ - Shell-visible `.pen` path:
182
+ - Claimed anchor ids:
183
+ - Reviewed screen ids:
184
+ - Source convergence: PASS | WARN | BLOCK
185
+ - Screen presence: PASS | WARN | BLOCK
186
+ - Review execution: PASS | WARN | BLOCK
187
+ - Final runtime gate status: PASS | WARN | BLOCK
188
+ - Notes:
189
+ ```
190
+
191
+ ### 为什么选 `pencil-design.md`
192
+
193
+ - 它本来就记录 source path、screens、screenshots 和设计说明
194
+ - 它离 runtime 设计真相最近
195
+ - 避免引入新的临时工件,导致流程继续分叉
196
+
197
+ ## 失败处理
198
+
199
+ 当 runtime gate 返回 `BLOCK`:
200
+
201
+ - 不允许继续 broad multi-screen expansion
202
+ - 不允许声称 design complete
203
+ - 不允许声称 workflow complete
204
+ - 必须把不一致显式记录到 `pencil-design.md`
205
+
206
+ 当 runtime gate 返回 `WARN`:
207
+
208
+ - 只有在不会造成 source ambiguity 的情况下才能继续
209
+ - 终态完成前仍要先解决或明确接受这个 warning
210
+
211
+ ## 和 Filesystem Audit 的协作
212
+
213
+ 顺序应该是:
214
+
215
+ 1. 先跑 runtime gate
216
+ 2. runtime gate 通过后,再跑 filesystem completion audit
217
+ 3. 两层都通过,才能宣称完成
218
+
219
+ 也就是:
220
+
221
+ 1. runtime gate
222
+ 2. filesystem completion audit
223
+ 3. terminal completion claim
224
+
225
+ ## 最小伪流程
226
+
227
+ ```md
228
+ 1. 第一次成功写入 Pencil
229
+ 2. 通过 MCP 读取 active editor
230
+ 3. 从 `pencil-design.md` 读取声称完成的 anchor ids
231
+ 4. 从 `design-registry.md` 读取登记 `.pen`
232
+ 5. 检查 shell-visible `.pen`
233
+ 6. 读取 live anchor 节点
234
+ 7. 评估 source convergence
235
+ 8. 评估 screen presence
236
+ 9. 在需要时评估 review execution
237
+ 10. 把 runtime gate 结果追加到 `pencil-design.md`
238
+ 11. 如果要声称终态完成,再跑 filesystem completion audit
239
+ 12. 两层都过,才能输出完成
240
+ ```
241
+
242
+ ## 边界决策
243
+
244
+ ### 当 Pencil MCP 不可用
245
+
246
+ 不要伪造 runtime gate。
247
+
248
+ 应该:
249
+
250
+ - 记录 MCP runtime gate 无法执行
251
+ - 回退到 filesystem audit 和已知约束
252
+ - 但不能把 runtime gate 记成已通过
253
+
254
+ ### 当还没有 anchor ids
255
+
256
+ 第一次成功写入后,可以先跑一个缩减版 source-convergence-only check。
257
+
258
+ 但不能假装 screen-presence 或 review-execution 已经完成。
259
+
260
+ ### 当还没有新的 Pencil 修改
261
+
262
+ 应返回 `WARN` 或 skip,而不是伪造 `PASS`。
263
+
264
+ ## 非功能要求
265
+
266
+ 第一版实现应该满足:
267
+
268
+ - deterministic
269
+ - artifact 记录是 append-only
270
+ - evaluator 可以针对 runtime snapshot 单独单元测试
271
+ - 不依赖 CLI transport 改造
272
+
273
+ ## 实现步骤
274
+
275
+ 建议顺序:
276
+
277
+ 1. 先定义 runtime snapshot 结构
278
+ 2. 再定义一个纯 evaluator
279
+ 3. 增加一个把结果追加到 `pencil-design.md` 的 writer
280
+ 4. 在 design-phase runtime checkpoint 中调用它
281
+ 5. 把终态完成规则改成“runtime gate + filesystem audit”双通过
282
+
283
+ ## 延后工作
284
+
285
+ 第一版不要带上:
286
+
287
+ - 自动修复 editor/source mismatch
288
+ - 多 session 状态和解
289
+ - 面向 live runtime 的 CLI 命令
290
+ - 通用 checkpoint orchestration engine
@@ -0,0 +1,244 @@
1
+ # MCP-Aware Gate 测试设计
2
+
3
+ 这份文档定义未来 MCP-aware gate 的测试覆盖设计。
4
+
5
+ 它是验证设计,不是测试实现。
6
+
7
+ ## 测试目标
8
+
9
+ 证明 MCP-aware gate:
10
+
11
+ - 能阻断假的 runtime 完成态
12
+ - 不会取代 filesystem audit
13
+ - 不会把健康的 runtime 设计会话误判成失败
14
+ - 在 runtime 信息不完整时,行为仍然可预测
15
+
16
+ ## 测试层级
17
+
18
+ 测试应覆盖三层。
19
+
20
+ ### 1. Evaluator 单元测试
21
+
22
+ 对纯 runtime-gate evaluator 输入 synthetic snapshot 做测试。
23
+
24
+ 原因:
25
+
26
+ - 反馈最快
27
+ - 可重复
28
+ - 不依赖真实 Pencil session
29
+
30
+ ### 2. Runtime 集成测试
31
+
32
+ 对 runtime-gate caller 使用真实或 fixture 化的 MCP 响应做测试。
33
+
34
+ 原因:
35
+
36
+ - 能证明 active editor 和 node 读取确实被正确解释
37
+
38
+ ### 3. 端到端工作流测试
39
+
40
+ 验证 runtime gate 和 filesystem audit 在真实工作流状态下是否能正确协作。
41
+
42
+ 原因:
43
+
44
+ - 防止 runtime gate 过了,但完成态仍然能说谎
45
+
46
+ ## 核心测试类别
47
+
48
+ ### A. 健康的 runtime source convergence
49
+
50
+ 期望:
51
+
52
+ - active editor 是有名的项目内 `.pen`
53
+ - 登记的 `.pen` 路径一致
54
+ - shell-visible `.pen` 存在
55
+ - 结果是 `PASS`
56
+
57
+ ### B. Live editor 仍然是 `new`
58
+
59
+ 期望:
60
+
61
+ - source convergence 为 `BLOCK`
62
+ - 即使 live editor 里有 screen,也不能完成
63
+
64
+ ### C. 登记的 `.pen` 在磁盘上不存在
65
+
66
+ 期望:
67
+
68
+ - source convergence 或 completion 状态变成 `BLOCK`
69
+ - runtime gate 不能把 live editor 单独当成充分条件
70
+
71
+ ### D. Live screen 存在,但没有持久化
72
+
73
+ 示例:
74
+
75
+ - active editor 中有 `Splash`、`Home`、`SafeBox`
76
+ - shell-visible `.pen` 不存在
77
+
78
+ 期望:
79
+
80
+ - runtime gate 能证明 screen 的确存在
81
+ - 但 source convergence 仍然是 `BLOCK`
82
+
83
+ ### E. 声称完成的 anchor id 缺失
84
+
85
+ 示例:
86
+
87
+ - `pencil-design.md` 声称有 `mCZ1G`
88
+ - 当前 live editor 中没有 `mCZ1G`
89
+
90
+ 期望:
91
+
92
+ - screen presence 为 `BLOCK`
93
+
94
+ ### F. Screenshot target 缺失
95
+
96
+ 期望:
97
+
98
+ - review execution 为 `BLOCK`
99
+
100
+ ### G. Review blocker 被忽略
101
+
102
+ 示例:
103
+
104
+ - screenshot review 已记录 blocker 级 layout-hygiene 问题
105
+ - 但工作流仍然把 anchor 标成 approved
106
+
107
+ 期望:
108
+
109
+ - review execution 为 `BLOCK`
110
+
111
+ ### H. Source mismatch 但有显式 reconciliation
112
+
113
+ 示例:
114
+
115
+ - active editor 路径和登记路径不同
116
+ - `pencil-design.md` 中记录了明确 reconciliation
117
+
118
+ 期望:
119
+
120
+ - 只有在 reconciliation 满足规则时,才允许 `WARN` 或 `PASS`
121
+
122
+ ### I. 还没有新的 Pencil 修改
123
+
124
+ 期望:
125
+
126
+ - runtime gate 返回 `WARN` 或 partial result
127
+ - 不能伪造 full `PASS`
128
+
129
+ ### J. Pencil MCP 不可用
130
+
131
+ 期望:
132
+
133
+ - runtime gate 报 unavailable 或 skipped
134
+ - 工作流不能把 runtime gate 视为已通过
135
+ - filesystem audit 仍然可以独立工作
136
+
137
+ ## 必须覆盖的端到端场景
138
+
139
+ ### 场景 1:Cipher 这次真实失败模式
140
+
141
+ 状态:
142
+
143
+ - active editor 是 `new`
144
+ - live screen 存在
145
+ - `.da-vinci/designs/` 被污染
146
+ - 没有 shell-visible `.pen`
147
+
148
+ 期望:
149
+
150
+ - runtime gate 阻断完成
151
+ - filesystem completion audit 也失败
152
+
153
+ ### 场景 2:健康的 redesign 完成态
154
+
155
+ 状态:
156
+
157
+ - active editor 就是登记的 `.pen`
158
+ - anchor ids 存在
159
+ - screenshot review 存在
160
+ - shell-visible `.pen` 存在
161
+ - completion audit 通过
162
+
163
+ 期望:
164
+
165
+ - runtime gate 通过
166
+ - completion audit 通过
167
+ - 允许终态完成
168
+
169
+ ### 场景 3:runtime 过了,filesystem 没过
170
+
171
+ 状态:
172
+
173
+ - active editor 正常
174
+ - shell-visible `.pen` 存在
175
+ - 但 `.da-vinci/designs/` 中混入 PNG 或 markdown
176
+
177
+ 期望:
178
+
179
+ - runtime gate 可以通过
180
+ - filesystem completion audit 失败
181
+ - 不允许终态完成
182
+
183
+ ### 场景 4:filesystem 过了,runtime 没过
184
+
185
+ 状态:
186
+
187
+ - shell-visible `.pen` 存在
188
+ - 磁盘结构也健康
189
+ - 但 active editor 仍然是 `new` 或指向别处
190
+
191
+ 期望:
192
+
193
+ - runtime gate 失败
194
+ - 不允许终态完成
195
+
196
+ ## 必须断言的内容
197
+
198
+ 每一条 runtime-gate 测试都应该断言:
199
+
200
+ - final status
201
+ - 各子层 status
202
+ - 触发的是哪条 blocking condition
203
+ - completion 是否允许继续
204
+ - 工件写入格式是否保持稳定
205
+
206
+ ## 工件记录测试
207
+
208
+ 需要验证 runtime gate 输出:
209
+
210
+ - 追加到 `pencil-design.md`
211
+ - 不会新增新的工件家族
212
+ - 不会写进 `.da-vinci/designs/`
213
+ - 不会覆盖无关 section
214
+
215
+ ## 回归场景
216
+
217
+ 这些回归必须覆盖:
218
+
219
+ 1. runtime gate 意外退化成 CLI-only audit
220
+ 2. runtime gate 静默接受 `new`
221
+ 3. runtime gate 把 PNG 当成设计源证据
222
+ 4. anchor id 缺失时 runtime gate 仍通过
223
+ 5. runtime gate 实际没跑,却被记成通过
224
+ 6. runtime gate 输出新的临时 markdown 文件到错误目录
225
+
226
+ ## 建议测试矩阵
227
+
228
+ 最小矩阵:
229
+
230
+ - form factor:先覆盖 mobile
231
+ - design stage:第一次 Pencil 写入 / anchor approved / terminal completion
232
+ - source state:healthy / `new` / diverged / missing `.pen`
233
+ - screen state:present / missing / stale ids
234
+ - review state:reviewed / missing / blocker ignored
235
+
236
+ ## Exit Criteria
237
+
238
+ 只有以下条件同时满足,才应该认为实现达标:
239
+
240
+ 1. evaluator 单元测试覆盖所有 blocker 分支
241
+ 2. 至少有一条 runtime 集成测试证明 live editor 检测可用
242
+ 3. Cipher 类失败场景被阻断
243
+ 4. 健康 redesign 场景可以通过
244
+ 5. runtime gate + filesystem audit 的双层组合,能够阻止假的终态完成