@xenonbyte/da-vinci-workflow 0.2.2 → 0.2.4

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 (72) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +49 -14
  3. package/README.zh-CN.md +169 -14
  4. package/commands/claude/dv/breakdown.md +8 -0
  5. package/commands/claude/dv/build.md +16 -0
  6. package/commands/claude/dv/continue.md +4 -0
  7. package/commands/claude/dv/design.md +5 -2
  8. package/commands/claude/dv/tasks.md +14 -0
  9. package/commands/claude/dv/verify.md +11 -0
  10. package/commands/codex/prompts/dv-breakdown.md +8 -0
  11. package/commands/codex/prompts/dv-build.md +16 -0
  12. package/commands/codex/prompts/dv-continue.md +4 -0
  13. package/commands/codex/prompts/dv-design.md +5 -2
  14. package/commands/codex/prompts/dv-tasks.md +14 -0
  15. package/commands/codex/prompts/dv-verify.md +10 -0
  16. package/commands/gemini/dv/breakdown.toml +8 -0
  17. package/commands/gemini/dv/build.toml +16 -0
  18. package/commands/gemini/dv/continue.toml +4 -0
  19. package/commands/gemini/dv/design.toml +5 -2
  20. package/commands/gemini/dv/tasks.toml +14 -0
  21. package/commands/gemini/dv/verify.toml +10 -0
  22. package/commands/templates/dv-continue.shared.md +4 -0
  23. package/docs/discipline-and-orchestration-upgrade.md +83 -0
  24. package/docs/dv-command-reference.md +61 -2
  25. package/docs/execution-chain-migration.md +23 -0
  26. package/docs/execution-chain-plan.md +10 -3
  27. package/docs/mode-use-cases.md +2 -1
  28. package/docs/pencil-rendering-workflow.md +15 -12
  29. package/docs/prompt-entrypoints.md +5 -0
  30. package/docs/prompt-presets/README.md +1 -1
  31. package/docs/prompt-presets/desktop-app.md +3 -3
  32. package/docs/prompt-presets/mobile-app.md +3 -3
  33. package/docs/prompt-presets/tablet-app.md +3 -3
  34. package/docs/prompt-presets/web-app.md +3 -3
  35. package/docs/skill-usage.md +61 -38
  36. package/docs/workflow-examples.md +16 -13
  37. package/docs/workflow-overview.md +19 -0
  38. package/docs/zh-CN/dv-command-reference.md +59 -2
  39. package/docs/zh-CN/execution-chain-migration.md +23 -0
  40. package/docs/zh-CN/mode-use-cases.md +2 -1
  41. package/docs/zh-CN/pencil-rendering-workflow.md +15 -12
  42. package/docs/zh-CN/prompt-entrypoints.md +5 -0
  43. package/docs/zh-CN/prompt-presets/README.md +1 -1
  44. package/docs/zh-CN/prompt-presets/desktop-app.md +3 -3
  45. package/docs/zh-CN/prompt-presets/mobile-app.md +3 -3
  46. package/docs/zh-CN/prompt-presets/tablet-app.md +3 -3
  47. package/docs/zh-CN/prompt-presets/web-app.md +3 -3
  48. package/docs/zh-CN/skill-usage.md +61 -38
  49. package/docs/zh-CN/workflow-examples.md +15 -13
  50. package/docs/zh-CN/workflow-overview.md +19 -0
  51. package/examples/greenfield-spec-markupflow/.da-vinci/state/execution-signals/demo__lint-tasks.json +16 -0
  52. package/lib/audit-parsers.js +166 -10
  53. package/lib/audit.js +3 -26
  54. package/lib/cli.js +156 -2
  55. package/lib/design-source-registry.js +146 -0
  56. package/lib/execution-profile.js +143 -0
  57. package/lib/execution-signals.js +19 -1
  58. package/lib/lint-tasks.js +86 -2
  59. package/lib/planning-parsers.js +255 -18
  60. package/lib/save-current-design.js +790 -0
  61. package/lib/supervisor-review.js +3 -2
  62. package/lib/task-execution.js +160 -0
  63. package/lib/task-review.js +197 -0
  64. package/lib/verify.js +152 -1
  65. package/lib/workflow-bootstrap.js +2 -13
  66. package/lib/workflow-persisted-state.js +3 -1
  67. package/lib/workflow-state.js +503 -33
  68. package/lib/worktree-preflight.js +214 -0
  69. package/package.json +1 -1
  70. package/references/artifact-templates.md +56 -6
  71. package/tui/catalog.js +103 -0
  72. package/tui/index.js +2274 -418
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.4 - 2026-04-02
4
+
5
+ ### Changed
6
+ - design-approval freshness gates now compare approval markers against `design.md`, `pencil-design.md`, and `pencil-bindings.md` modification times
7
+ - planning parser verification command extraction now accepts template-standard `da-vinci verify-*` commands in `tasks.md`
8
+ - worktree preflight now degrades to advisory warning and recommends isolation when `git status` is unavailable (including non-git directories)
9
+ - supervisor-review retry normalization now preserves explicit `0` retry configuration instead of silently falling back to defaults
10
+ - Chinese README now includes missing parity sections for checkpoint policy, execution policy, spec granularity, design input collection, repo-local forward-test reference, and current status
11
+
12
+ ### Fixed
13
+ - resolve-change failure envelopes in `task-execution` and `task-review` no longer emit `undefined` when failure arrays are empty
14
+ - `.kongming/` workspace output is now ignored by repository git tracking
15
+
16
+ ## v0.2.3 - 2026-04-02
17
+
18
+ ### Added
19
+ - scene-first `Design Ops` actions in TUI for managed `save-current-design`, icon sync progress feedback, and platform+quality Visual Assist presets
20
+ - additional TUI/CLI regression coverage for scene ordering, route mapping, and environment-stable `save-current-design` unavailable behavior
21
+
22
+ ### Changed
23
+ - TUI root scenes now keep the documented order (`Install & Uninstall`, `Current Status`, `Switch Work Item`, `Design Ops`, `Pre-Implementation Checks`, `Pre-Acceptance Checks`, `Settings`)
24
+ - `Current Status` route mapping now keeps `/dv:tasks`, `/dv:build`, and bootstrap routes as direct command recommendations instead of forcing mismatched scene actions
25
+ - README (EN/ZH) now documents the updated scene-first behavior and release highlights for `0.2.3`
26
+
27
+ ### Fixed
28
+ - removed stale Advanced-command branches from TUI runtime routing and key handling so only reachable scene navigation paths remain
29
+ - stabilized `save-current-design` unavailable-path CLI testing by isolating PATH during bridge-absent assertions
30
+
3
31
  ## v0.2.2 - 2026-03-31
4
32
 
5
33
  ### Added
package/README.md CHANGED
@@ -28,18 +28,36 @@ This workflow is intended for:
28
28
 
29
29
  Latest published npm package:
30
30
 
31
- - `@xenonbyte/da-vinci-workflow@0.2.2`
31
+ - `@xenonbyte/da-vinci-workflow@0.2.4`
32
32
 
33
- Release highlights for `0.2.2`:
33
+ Release highlights for `0.2.4`:
34
34
 
35
- - added the built-in terminal TUI via `da-vinci tui` and `da-vinci-tui`, with phase-grouped command discovery, bilingual labels, command previews, and project/change context management
36
- - added command-parameter help inside the TUI so operators can inspect supported flags and placeholder requirements without leaving the terminal
37
- - added operator-facing English and Chinese workflow guides that explain first-run routing, implementation handoff, pause/resume rules, and TUI usage
38
- - expanded release coverage with TUI-specific regression tests plus package-content checks for the dedicated TUI bin and shipped `tui/` assets
39
- - fixed TUI exit handling so `q` and `Ctrl-C` actually terminate the interactive session instead of leaving stdin resumed in the foreground
40
- - fixed preview-command editing so unclosed quotes are handled as a recoverable TUI error instead of crashing the process
41
- - fixed TUI JSON toggling by moving the shortcut to `J`, preserving `j/k` for navigation only
42
- - fixed TUI child-command execution so relative paths resolve from the active project context selected in the header
35
+ - design-approval stale detection now checks `design.md`, `pencil-design.md`, and `pencil-bindings.md` instead of only one artifact timestamp
36
+ - `lint-tasks` verification command parsing now accepts `da-vinci verify-*` commands from the current task template
37
+ - `worktree-preflight` now warns and recommends isolation when a project is not a git repository (or `git status` cannot be read)
38
+ - `supervisor-review` retry parsing now honors explicit `--review-retries 0` without falling back to default retries
39
+ - `task-execution` and `task-review` resolve-failure messaging now keeps defensive fallback text instead of leaking `undefined`
40
+
41
+ ## Discipline And Orchestration Upgrade
42
+
43
+ The upgrade specification is tracked by:
44
+
45
+ - `openspec/changes/discipline-and-orchestration-upgrade/`
46
+
47
+ Implemented capability set:
48
+
49
+ - design-approval discipline before implementation handoff
50
+ - stronger `lint-tasks` quality checks for execution readiness
51
+ - bounded orchestration hints (roles, concurrency, review order) derived from workflow state
52
+ - structured implementer and two-stage task-review evidence
53
+ - completion wording discipline backed by fresh verification evidence
54
+ - optional worktree preflight for isolation-sensitive execution
55
+ - structured `task-execution` and `task-review` command surfaces for per-task evidence
56
+
57
+ This upgrade does **not** replace artifact truth, checkpoint truth, or completion audit authority.
58
+ `workflow-status`, `next-step`, and orchestration outputs remain bounded by the existing contract.
59
+
60
+ See [docs/discipline-and-orchestration-upgrade.md](/Users/xubo/x-skills/da-vinci/docs/discipline-and-orchestration-upgrade.md) for operator and maintainer guidance, and the OpenSpec change folder for implementation details.
43
61
 
44
62
  ## Supported workflow modes
45
63
 
@@ -87,7 +105,11 @@ Route discipline:
87
105
  - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` and `da-vinci next-step --project <path> [--change <id>]` before selecting continuation route text
88
106
  - run `da-vinci lint-spec --project <path> [--change <id>]` before implementation when runtime spec quality is uncertain
89
107
  - run `da-vinci scope-check --project <path> [--change <id>]` before implementation when page/state propagation across planning artifacts is uncertain
108
+ - run `da-vinci worktree-preflight --project <path> [--change <id>]` before bounded-parallel execution to decide whether isolation is recommended
109
+ - use `da-vinci task-execution --project <path> --change <id> --task-group <id> ...` to persist implementer result envelopes (`DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCKED`)
110
+ - use `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> ...` to persist ordered two-stage review evidence
90
111
  - run `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage` before terminal completion claims
112
+ - require fresh verification evidence plus `da-vinci audit --mode completion --change <id> <project-path>` before any terminal completion claim
91
113
  - run `da-vinci generate-sidecars --project <path> [--change <id>]` and `da-vinci diff-spec --project <path> [--change <id>]` when planning deltas must be tracked explicitly
92
114
  - `continue` should determine route selection from artifact and checkpoint truth first
93
115
  - contextual checkpoint deltas are auxiliary recovery notes only and must not override routing
@@ -99,8 +121,18 @@ If the growing CLI surface is the main usability problem, use the built-in termi
99
121
 
100
122
  - launch with `da-vinci tui` or `da-vinci-tui`
101
123
  - use `npx -p @xenonbyte/da-vinci-workflow da-vinci tui` when the package is not installed globally
102
- - the TUI groups commands by workflow phase, supports English and Chinese descriptions, and lets you launch the selected command after previewing it
103
- - `p` sets project path context, `c` sets change-id context, `l` toggles language, `m` edits the preview command, and `Enter` runs it
124
+ - the root menu is scene-first: `Install & Uninstall`, `Current Status`, `Switch Work Item`, `Design Ops`, `Pre-Implementation Checks`, `Pre-Acceptance Checks`, `Settings`
125
+ - `Pre-Implementation Checks` is a direct readiness gate for implementation
126
+ - persistent header is intentionally minimal: brand + current project + current change
127
+ - `Design Ops > Save Current Design` persists the current live editor state back to the project-owned `.pen` source
128
+ - `Design Ops > Visual Assist Preset` maps `Masterpiece`/`High Quality`/`Normal` to platform preset variants `Required Supervisor Signoff`/`Advisory Supervisor Review`/`Adapter-Only`
129
+ - `Install & Uninstall` provides three actions: `Status` (show `da-vinci status`), `Install` (install all supported platforms), and `Uninstall` (uninstall all supported platforms)
130
+ - Visual Assist preset output is always English and updates only the `## Visual Assist` block in project-root `DA-VINCI.md` after platform+quality selection (it does not rewrite unrelated sections)
131
+ - `Current Status` now keeps route guidance honest: when `next-step` points to `/dv:tasks`, `/dv:build`, or bootstrap, TUI keeps it as a direct command recommendation instead of forcing a mismatched scene
132
+ - `Settings` now keeps only `Language` and `Logs`
133
+ - `Settings > Logs` shows project-local daily diagnostics from `.da-vinci/logs/YYYY-MM-DD.ndjson`; logs are troubleshooting evidence, not workflow truth
134
+ - it supports English/Chinese chrome, light/dark theme auto-detection, and `t` as a manual fallback
135
+ - `p` sets project context, `c` sets change context, `l` toggles language, `J` toggles `--json`, and `Enter` opens/runs the selected item
104
136
 
105
137
  Use [docs/skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/skill-usage.md) for the operator-facing workflow, resume rules, and TUI guidance.
106
138
 
@@ -495,7 +527,8 @@ During active redesign work, run `da-vinci audit --mode integrity <project-path>
495
527
  Project-local `.pen` persistence now has two supported paths:
496
528
 
497
529
  - first-run path: seed the registered project-local `.pen` with `da-vinci ensure-pen --output <path> --verify-open`, open that exact path, then persist later MCP snapshot writes back to the same file
498
- - resume path: if a registered project-local `.pen` already exists, reopen it for continuity, but after material live edits persist a fresh live MCP snapshot back to that same path and run `da-vinci check-pen-sync`
530
+ - resume path: if a registered project-local `.pen` already exists, reopen it for continuity, then use `da-vinci save-current-design --project <project-path>` after material live edits
531
+ - treat `save-current-design` outcomes explicitly: `saved` means persisted, `blocked` means bound-source contract failure, and `unavailable` means the runtime bridge could not capture a live snapshot
499
532
  - multi-source guard: when external `.pen` sources also exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before each new `pencil-session begin`; if hashes diverge, confirm source priority explicitly and sync the chosen source into `<project-pen>` before new edits
500
533
 
501
534
  On autonomous redesign runs, the session wrapper is required when it is available. Lower-level helpers remain available only when the wrapper truly cannot be used.
@@ -504,8 +537,10 @@ Persistence helpers:
504
537
 
505
538
  - required wrapper on autonomous runs:
506
539
  - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
507
- - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
540
+ - `da-vinci save-current-design --project <project-path> [--json] [--continue-on-error]`
508
541
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
542
+ - low-level fallback when high-level save reports `unavailable`:
543
+ - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
509
544
  - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
510
545
  - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
511
546
  - `da-vinci ensure-pen --output <path> --verify-open`
package/README.zh-CN.md CHANGED
@@ -30,18 +30,36 @@ Da Vinci 是一个把产品需求一路推进到结构化规格、Pencil 设计
30
30
 
31
31
  最新已发布 npm 包:
32
32
 
33
- - `@xenonbyte/da-vinci-workflow@0.2.2`
33
+ - `@xenonbyte/da-vinci-workflow@0.2.4`
34
34
 
35
- `0.2.2` 版本重点:
35
+ `0.2.4` 版本重点:
36
36
 
37
- - 新增内置终端 TUI:可通过 `da-vinci tui` `da-vinci-tui` 启动,按阶段分组浏览命令,支持中英文说明、命令预览以及 project/change 上下文维护
38
- - 新增 TUI 内的命令参数帮助,可以直接在终端里查看支持的 flag、占位符和必填参数
39
- - 新增中英文 operator 文档,专门说明第一次如何进入、实现前如何衔接、中途退出后怎么恢复,以及 TUI 怎么配合
40
- - 回归测试与打包校验现已覆盖 TUI 专项路径,包括独立 bin、`tui/` 目录资产和帮助输出
41
- - 修复 TUI 退出路径:`q` `Ctrl-C` 现在会真正结束会话,不再把进程留在前台挂住
42
- - 修复预览命令编辑:未闭合引号现在会显示可恢复错误页,不再直接把 TUI 进程打崩
43
- - 修复 TUI JSON 切换快捷键冲突:现在使用 `J` 切换 `--json`,`j/k` 只负责移动
44
- - 修复 TUI 子命令执行目录:相对路径现在会基于当前 header 里选中的项目上下文解析
37
+ - 设计批准的 stale 检测从单一 `design.md` 扩展为同时检查 `design.md`、`pencil-design.md`、`pencil-bindings.md`
38
+ - `lint-tasks` verification command 解析已支持当前模板里的 `da-vinci verify-*` 命令
39
+ - `worktree-preflight` 在“非 git 仓库”或 `git status` 失败时会返回告警并建议隔离执行
40
+ - `supervisor-review` 现在正确处理显式 `--review-retries 0`,不再错误回退到默认重试
41
+ - `task-execution` / `task-review` resolve-change 失败路径上补强了防御性错误回退,避免输出 `undefined`
42
+
43
+ ## Discipline And Orchestration 升级
44
+
45
+ 该升级的规格与追踪在:
46
+
47
+ - `openspec/changes/discipline-and-orchestration-upgrade/`
48
+
49
+ 当前已实现能力:
50
+
51
+ - 在实现交接前增加设计批准纪律闸门
52
+ - 强化 `lint-tasks` 的执行就绪质量检查
53
+ - 基于 workflow state 给出有边界的编排提示(角色、并发、审查顺序)
54
+ - 增加结构化 implementer 结果与两阶段 task review 证据
55
+ - 用 fresh verification evidence 约束 completion 表述
56
+ - 为隔离敏感的执行场景提供可选 worktree preflight
57
+ - 提供结构化 `task-execution` / `task-review` 命令面用于任务级证据落盘
58
+
59
+ 该升级**不会**替代现有 artifact truth、checkpoint truth 和 completion audit 权威。
60
+ `workflow-status`、`next-step` 与 orchestration 输出仍然受现有契约约束。
61
+
62
+ 可先阅读 [docs/discipline-and-orchestration-upgrade.md](/Users/xubo/x-skills/da-vinci/docs/discipline-and-orchestration-upgrade.md) 了解说明,再结合 OpenSpec 目录查看具体实现拆分。
45
63
 
46
64
  ## 支持的工作流模式
47
65
 
@@ -92,7 +110,11 @@ Da Vinci 当前支持五种模式:
92
110
  - 有 shell 能力时,优先先跑 `da-vinci workflow-status --project <path> [--change <id>] --json` 与 `da-vinci next-step --project <path> [--change <id>]` 再决定 continue 的路由文本
93
111
  - 如果运行时 spec 质量不确定,进入实现前先跑 `da-vinci lint-spec --project <path> [--change <id>]`
94
112
  - 如果页面/状态在规划工件之间的传播关系不确定,进入实现前先跑 `da-vinci scope-check --project <path> [--change <id>]`
113
+ - 计划走并行执行前,先跑 `da-vinci worktree-preflight --project <path> [--change <id>]` 评估是否应启用隔离
114
+ - 用 `da-vinci task-execution --project <path> --change <id> --task-group <id> ...` 记录 implementer 结果包(`DONE`、`DONE_WITH_CONCERNS`、`NEEDS_CONTEXT`、`BLOCKED`)
115
+ - 用 `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> ...` 记录两阶段有序 review 证据
95
116
  - 终态前先跑 `da-vinci verify-bindings` / `verify-implementation` / `verify-structure` / `verify-coverage`
117
+ - 任何终态 completion 表述前,必须同时具备 fresh verification evidence 与 `da-vinci audit --mode completion --change <id> <project-path>` 通过
96
118
  - 需要显式追踪规划变更时,先 `da-vinci generate-sidecars --project <path> [--change <id>]`,再 `da-vinci diff-spec --project <path> [--change <id>]`
97
119
  - `continue` 的选路应先看工件和 checkpoint 真相,再看上下文补充信息
98
120
  - Context Delta 只用于恢复上下文,不是阶段判定真相源
@@ -104,8 +126,19 @@ Da Vinci 当前支持五种模式:
104
126
 
105
127
  - 用 `da-vinci tui` 或 `da-vinci-tui` 启动
106
128
  - 没有全局安装时,用 `npx -p @xenonbyte/da-vinci-workflow da-vinci tui`
107
- - TUI 会按工作流阶段对命令分组,支持中英文说明,并在执行前先给出命令预览
108
- - `p` 设置项目路径上下文,`c` 设置 change-id 上下文,`l` 切换语言,`m` 编辑预览命令,`Enter` 执行
129
+ - 首屏按场景组织:`安装与卸载`、`当前状态`、`切换工作项`、`设计操作`、`实施前检查`、`验收前检查`、`设置`
130
+ - 顶部信息最小化:只保留品牌、当前项目、当前 change
131
+ - `设计操作 > 保存当前设计稿` 会把当前 live 编辑器状态回写到项目管理的 `.pen` 设计源
132
+ - `提示词模版` 从英文权威源 `docs/prompt-presets/` 取内容,支持预览和复制
133
+ - `mode1..mode5` 分别映射 `Simple redesign`、`Complex redesign`、`Redesign with reference directory`、`Design-only`、`Continue`
134
+ - `设计操作 > Visual Assist 预设` 中 `Masterpiece`/`High Quality`/`Normal` 分别映射平台预设里的 `Required Supervisor Signoff`/`Advisory Supervisor Review`/`Adapter-Only`
135
+ - `安装与卸载` 提供三个动作:`状态`(查看 `da-vinci status`)、`安装`(一键安装所有支持平台)、`卸载`(一键卸载所有支持平台)
136
+ - Visual Assist 预设写入始终输出英文;在完成“平台 + 质量”选择后只更新项目根 `DA-VINCI.md` 的 `## Visual Assist` 区块,不会改写其他章节
137
+ - `当前状态` 现在会保持路由建议真实:当 `next-step` 建议 `/dv:tasks`、`/dv:build` 或 bootstrap 时,TUI 会给出直接命令建议,而不是强行映射到不匹配场景
138
+ - `设置` 现在只保留 `语言` 和 `日志`
139
+ - `设置 > 日志` 读取项目内 `.da-vinci/logs/YYYY-MM-DD.ndjson` 的每日诊断日志;日志是排障证据,不是工作流真相源
140
+ - 支持中英文界面与浅色/深色自动识别,`t` 可手动切换主题
141
+ - `p` 设置项目上下文,`c` 设置 change 上下文,`l` 切语言,`J` 切 `--json`,`Enter` 进入/执行
109
142
 
110
143
  如果你想看“人到底怎么用这个 skill、暂停后怎么续跑、TUI 怎么配合”的完整说明,直接看 [docs/zh-CN/skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/skill-usage.md)。
111
144
 
@@ -230,6 +263,14 @@ Da Vinci 的默认顺序是:
230
263
  - `tasks.md`:任务分组和实施顺序
231
264
  - `verification.md`:覆盖度和漂移检查
232
265
 
266
+ ### Spec 粒度规则
267
+
268
+ spec 应按能力边界或重设计切片来拆分,不要按“页面数量”机械拆分。
269
+
270
+ 对于范围较大的 `redesign-from-code`,优先拆成多个 `specs/<slice>/spec.md`,不要堆成一个超大的 `ui-refresh/spec.md`。
271
+
272
+ 对于范围较大的 `overhaul-from-code`,优先使用多个 `specs/<slice>/spec.md` + 一个 `migration-contract.md`,不要把“保留行为”和“废弃行为”混在单一重写 spec 里。
273
+
233
274
  ## 工件放置建议
234
275
 
235
276
  推荐结构:
@@ -274,6 +315,54 @@ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
274
315
 
275
316
  这个命令会先生成项目级 `.da-vinci/` 工件、默认项目内 `.pen`,以及当前工作流所要求的最小 change 级设计工件。
276
317
 
318
+ ## Checkpoints
319
+
320
+ Da Vinci 使用以下检查点:
321
+
322
+ 1. `discovery checkpoint`
323
+ 2. `spec checkpoint`
324
+ 3. `design checkpoint`
325
+ 4. `design-source checkpoint`
326
+ 5. `mapping checkpoint`
327
+ 6. `task checkpoint`
328
+ 7. `execution checkpoint`
329
+
330
+ 检查结果:
331
+
332
+ - `PASS`
333
+ - `WARN`
334
+ - `BLOCK`
335
+
336
+ Context Delta 记录约束:
337
+
338
+ - 在已有 change 工件里维护简洁 `Context Delta`(常见是 `pencil-design.md`、`tasks.md`、`verification.md`)
339
+ - Context Delta 仅用于恢复上下文,不是阶段真相源
340
+
341
+ ## Execution Policy
342
+
343
+ Da Vinci 默认是 `autonomous-by-default`。
344
+
345
+ 这意味着:
346
+
347
+ - 不会在每个阶段都停下来等待用户确认
348
+ - checkpoint 是内部质量门禁,不是审批门禁
349
+ - 只有遇到真实阻塞才停
350
+
351
+ 默认行为:
352
+
353
+ - `PASS` -> 继续
354
+ - `WARN` -> 记录并继续
355
+ - `BLOCK` -> 仅在无法从现有工件或本地上下文消解时停止
356
+ - Context Delta 缺失或状态不一致 -> 告警并继续
357
+
358
+ 常见停止条件:
359
+
360
+ - 用户明确要求暂停
361
+ - 缺失输入会实质改变设计或实现结果
362
+ - 需要外部授权或认证
363
+ - 多个真相源冲突到无法可靠判断
364
+ - 即将执行破坏性、会改变基线的动作
365
+
277
366
  ## 设计源规则
278
367
 
279
368
  - `DA-VINCI.md` 是跨页面视觉一致性的项目级视觉契约
@@ -333,6 +422,23 @@ da-vinci bootstrap-project --project /abs/path/to/project --change <change-id>
333
422
  - 默认把它当成非阻塞增强层
334
423
  - 只有用户明确要求必须使用某个 adapter 时,缺失才应阻塞工作流
335
424
 
425
+ ## 设计输入收集
426
+
427
+ 在 greenfield 项目开始 Pencil 设计前,Da Vinci 应先收集或推断:
428
+
429
+ - 项目是否已有 `DA-VINCI.md`
430
+ - 目标平台与设备形态(mobile / tablet / desktop / web)
431
+ - 品牌方向、字体方向、色彩风格和密度预期
432
+ - 是否存在必须遵守的设计约束(设计系统、交互约束、无障碍约束)
433
+ - 是否存在外部参考素材(截图、竞品、风格板、历史设计稿)
434
+ - 设计输出是否只交付设计,还是会继续进入实现与验收
435
+
436
+ 如果输入不足以稳定方向:
437
+
438
+ - 先在 `design-brief.md` 记录待确认项与临时假设
439
+ - 用最小可验证设计面推进,不直接铺开全量页面
440
+ - 在下一轮 checkpoint 明确补齐缺失输入
441
+
336
442
  ## 安装
337
443
 
338
444
  安装 npm 包:
@@ -416,7 +522,8 @@ Context Delta 与 audit 的关系:
416
522
  项目内 `.pen` 持久化现在分成两条受支持路径:
417
523
 
418
524
  - 首次运行路径:先用 `da-vinci ensure-pen --output <path> --verify-open` seed 登记好的项目内 `.pen`,打开这个精确路径,然后把后续 MCP 快照持续写回同一个文件
419
- - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;但发生实质性 live edit 后,要把当前 live MCP 快照重新持久化回同一路径,并运行 `da-vinci check-pen-sync`
525
+ - 继续迭代路径:如果项目里原本已有登记的 `.pen`,先打开它继续工作;发生实质性 live edit 后,优先执行 `da-vinci save-current-design --project <project-path>`
526
+ - `save-current-design` 结果必须分开处理:`saved` 才代表已持久化;`blocked` 代表绑定源契约失败;`unavailable` 代表 runtime bridge 无法抓取 live 快照
420
527
  - 多源门禁:如果还存在外部 `.pen` 源,每次新一轮 `pencil-session begin` 前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若 hash 不一致,必须先确认来源优先级并把选中的来源同步回 `<project-pen>`
421
528
 
422
529
  如果是自治运行,session wrapper 只要可用就必须使用。只有 wrapper 确实不可用时,才退回底层 helper。
@@ -425,8 +532,10 @@ Context Delta 与 audit 的关系:
425
532
 
426
533
  - 自治运行必须使用的 session 命令:
427
534
  - `da-vinci pencil-session begin --project <project-path> --pen <path> [--baseline <path>] [--prefer-source <path>] [--sync-preferred-source]`
428
- - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
535
+ - `da-vinci save-current-design --project <project-path> [--json] [--continue-on-error]`
429
536
  - `da-vinci pencil-session end --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
537
+ - 当高层保存返回 `unavailable` 时,才回退到底层链路:
538
+ - `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <batch-get-json> --variables-file <get-variables-json> --version <version>`
430
539
  - `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>[,<other-pen>...] [--prefer-source <path>]`
431
540
  - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
432
541
  - `da-vinci ensure-pen --output <path> --verify-open`
@@ -495,6 +604,38 @@ $da-vinci use continue for <existing workflow state>
495
604
  /dv:continue
496
605
  ```
497
606
 
607
+ ## 仓库内 forward-test 参考
608
+
609
+ 仓库里有一个“文档优先”的 forward-test 参考样例:
610
+
611
+ - `examples/greenfield-spec-markupflow/`
612
+
613
+ 该样例记录了 `greenfield-spec` 场景从以下阶段推进的完整链路:
614
+
615
+ 1. design brief
616
+ 2. proposal 与 spec
617
+ 3. page map
618
+ 4. Pencil 设计源登记
619
+ 5. Pencil 页面绑定
620
+ 6. implementation tasks
621
+ 7. 静态 HTML 交付
622
+ 8. verification
623
+
624
+ 它不是可直接喂给 `da-vinci audit` 的完整 fixture。样例为了可读性把工件放在仓库根;而当前 audit 期望的是完整 `.da-vinci/` 树和持久化状态元数据。
625
+
626
+ 如果你要把样例形态转换成可执行审计的项目骨架,请先运行:
627
+
628
+ ```bash
629
+ da-vinci bootstrap-project --project <project-path> --change <change-id>
630
+ ```
631
+
632
+ reviewer bridge 覆盖策略:
633
+
634
+ - 默认 CI 始终运行本地核心门禁(`npm run quality:ci:core`)
635
+ - 仅在仓库集成变量可用时,主 CI 才追加真实 reviewer bridge smoke 任务
636
+ - 真实 `codex exec` reviewer smoke 仍是显式 opt-in:`DA_VINCI_RUN_SUPERVISOR_INTEGRATION=1 npm run test:supervisor-review-integration`
637
+ - `.github/workflows/reviewer-bridge-smoke.yml` 提供手动/定时 smoke;启用后会把集成缺线视为失败,而不是静默 `SKIP`
638
+
498
639
  ## 示例请求
499
640
 
500
641
  ### Greenfield spec
@@ -604,3 +745,17 @@ da-vinci/
604
745
  │ └── zh-CN/
605
746
  └── references/
606
747
  ```
748
+
749
+ ## 当前状态
750
+
751
+ 当前仓库包含:
752
+
753
+ - Da Vinci skill 本体
754
+ - 三平台命令适配(Codex / Claude / Gemini)
755
+ - 工作流参考文档
756
+ - 可执行示例
757
+
758
+ 下一阶段自然演进方向:
759
+
760
+ 1. 持续补强 install / uninstall / status 的回归覆盖
761
+ 2. 在真实项目上做带提交历史的 forward-test(含项目内 `.pen` 设计源)
@@ -7,6 +7,14 @@ Use the Da Vinci workflow for this request.
7
7
 
8
8
  Action: `breakdown`
9
9
 
10
+ Before handing requirements off to design when shell access is available:
11
+ - run `da-vinci workflow-status --project <path> [--change <id>] --json`
12
+ - run `da-vinci next-step --project <path> [--change <id>]`
13
+ - run `da-vinci lint-spec --project <path> [--change <id>] --strict`
14
+ - treat command output as the gate; do not replace `BLOCK` or non-zero results with narrative judgment
15
+ - if the primary recommended route is still `/dv:breakdown`, keep refining `proposal.md` and specs instead of forcing design
16
+ - do not move to `/dv:design` until the command-backed checks stop blocking
17
+
10
18
  Focus on:
11
19
  - scope
12
20
  - pages
@@ -7,6 +7,19 @@ Use the Da Vinci workflow for this request.
7
7
 
8
8
  Action: `build`
9
9
 
10
+ Before broad implementation when shell access is available:
11
+ - run `da-vinci workflow-status --project <path> [--change <id>] --json`
12
+ - run `da-vinci next-step --project <path> [--change <id>]`
13
+ - if the primary recommended route is not `/dv:build`, stop and continue from that route instead of forcing implementation
14
+ - run `da-vinci lint-spec --project <path> [--change <id>]`
15
+ - run `da-vinci scope-check --project <path> [--change <id>]`
16
+ - if `tasks.md` exists, run `da-vinci lint-tasks --project <path> [--change <id>]`
17
+ - if both `pencil-design.md` and `pencil-bindings.md` exist, run `da-vinci lint-bindings --project <path> [--change <id>]`
18
+ - inspect `executionProfile` and discipline blockers from `da-vinci next-step --project <path> [--change <id>] --json`
19
+ - if profile mode is `bounded_parallel`, run `da-vinci worktree-preflight --project <path> [--change <id>]` and downgrade to serial unless isolation is ready or explicitly accepted
20
+ - treat command output as the gate; do not downgrade `BLOCK` or non-zero results into soft guidance
21
+ - treat any `BLOCK` or missing required planning/design artifact as a hard stop before broad implementation
22
+
10
23
  Focus on:
11
24
  - requirements-backed behavior
12
25
  - Pencil-backed layout and presentation
@@ -14,10 +27,13 @@ Focus on:
14
27
 
15
28
  During implementation:
16
29
  - run `execution checkpoint` after each top-level task group
30
+ - persist per-task implementer evidence via `da-vinci task-execution --project <path> --change <id> --task-group <id> --status <...> --summary <...>`
31
+ - persist ordered review evidence via `da-vinci task-review --project <path> --change <id> --task-group <id> --stage spec ...` then `--stage quality ...`
17
32
  - update source artifacts before continuing if drift is found
18
33
 
19
34
  Completion discipline:
20
35
  - treat `BUILD SUCCESSFUL` as compile-only evidence, not workflow completion
21
36
  - do not report `design complete` or `workflow complete` while in-scope task groups remain unfinished
37
+ - do not use terminal completion wording without fresh verification evidence
22
38
  - before any terminal completion claim, require `da-vinci audit --mode completion --change <change-id> <project-path>` to pass
23
39
  - if completion audit fails, continue from the minimal unfinished stage instead of exiting
@@ -23,14 +23,18 @@ Route discipline:
23
23
  - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
24
24
  - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
25
25
  - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
26
+ - prefer `da-vinci next-step --project <path> [--change <id>] --json` when available so discipline markers, execution profile hints, and verification freshness are explicit
26
27
  - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
27
28
  - do not restart discovery if the current artifacts already contain enough truth
28
29
  - determine route selection from artifact and checkpoint truth before reading contextual deltas
29
30
  - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
30
31
  - use contextual deltas as auxiliary recovery context only; they must not override route selection
31
32
  - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
33
+ - if design approval discipline markers are missing, malformed, or stale, keep routing in design/task refinement rather than promoting directly into implementation
32
34
  - do not default the user into `/dv:build` unless the project is clearly implementation-ready
33
35
  - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/dv:tasks`
34
36
  - only prefer `/dv:build` once task generation and implementation readiness are already clear
35
37
  - do not route into `/dv:build` when any design gate is unresolved: missing shell-visible project-local `.pen`, active/unclosed Pencil session, runtime/design-source checkpoint still BLOCK, or required design-supervisor review still BLOCK/unaccepted
38
+ - if bounded-parallel execution is hinted, include `da-vinci worktree-preflight --project <path> [--change <id>]` before emitting a parallel implementation continuation prompt
39
+ - avoid terminal completion wording unless fresh verification evidence and completion audit requirements are explicit
36
40
  - continuation prompts should usually target the main workflow entry so Da Vinci can resume the full state machine
@@ -20,10 +20,13 @@ Create or update:
20
20
  Run the `design checkpoint` before locking implementation tasks.
21
21
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
22
22
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
23
- Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
23
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci save-current-design`, and `da-vinci pencil-session end`.
24
24
  Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
25
25
  When multiple `.pen` sources exist (for example an external backup), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before `pencil-session begin`. If hashes diverge, confirm source priority explicitly and sync the chosen source into the project-local `.pen` (for example `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`) before continuing edits.
26
- If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
26
+ If a registered project-local `.pen` already exists, reopen it for continuity and use `da-vinci save-current-design --project <project-path>` after material edits.
27
+ Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; never treat `unavailable` as a successful save.
28
+ Use the lower-level `pencil-session persist` payload path only when the high-level save bridge is unavailable.
29
+ The MVP guarantee is bound source-path safety (`registered .pen`, session `penPath`, and active editor path converge), not exact window-instance identity before MCP exposes stable window/editor identifiers.
27
30
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
28
31
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
29
32
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.
@@ -13,7 +13,21 @@ Focus on:
13
13
  - Pencil coverage
14
14
  - dependency order
15
15
 
16
+ Task-plan discipline:
17
+ - include exact file or code-area ownership targets per task group
18
+ - include explicit verification commands, not only abstract verification wording
19
+ - include execution intent hints (`serial`, `bounded_parallel`, or `review_required`) and review intent
20
+ - include parseable discipline markers for design approval, plan self-review, and operator review acknowledgment
21
+
16
22
  Create or update:
17
23
  - `tasks.md`
18
24
 
25
+ Before claiming implementation-ready task planning:
26
+ - re-check that the workflow is still in the `/dv:tasks` lane when route context is stale or unclear
27
+ - run the `task checkpoint`
28
+ - when shell access is available, run `da-vinci lint-tasks --project <path> [--change <id>]`
29
+ - if both `pencil-design.md` and `pencil-bindings.md` exist, run `da-vinci lint-bindings --project <path> [--change <id>]`
30
+ - treat command output as the gate; do not downgrade `BLOCK` or non-zero results into soft guidance
31
+ - do not hand off to `build` while task coverage or bindings readiness are still blocking
32
+
19
33
  Run the `task checkpoint` before implementation begins.
@@ -15,4 +15,15 @@ Check:
15
15
  Create or update:
16
16
  - `verification.md`
17
17
 
18
+ When shell access is available:
19
+ - run `da-vinci verify-bindings --project <path> [--change <id>]`
20
+ - run `da-vinci verify-implementation --project <path> [--change <id>]`
21
+ - run `da-vinci verify-structure --project <path> [--change <id>]`
22
+ - run `da-vinci verify-coverage --project <path> [--change <id>]`
23
+ - treat command output as the gate; do not downgrade `BLOCK` or `FAIL` into soft guidance
24
+ - if any verification surface is still `BLOCK` or `FAIL`, keep the workflow in verification and record the drift instead of claiming success
25
+ - require fresh verification evidence in `verify-coverage` and `workflow-status` before any terminal completion wording
26
+ - if task-review evidence is recorded, keep unresolved `WARN/BLOCK` task-review stages open instead of closing the task group
27
+
18
28
  If Pencil MCP is active and terminal completion is being considered, re-check the MCP runtime gate evidence before treating verification as complete.
29
+ Before any terminal completion claim, require `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
@@ -7,6 +7,14 @@ Use the `da-vinci` skill for this request.
7
7
 
8
8
  Action: `breakdown`
9
9
 
10
+ Before handing requirements off to design when shell access is available:
11
+ - run `da-vinci workflow-status --project <path> [--change <id>] --json`
12
+ - run `da-vinci next-step --project <path> [--change <id>]`
13
+ - run `da-vinci lint-spec --project <path> [--change <id>] --strict`
14
+ - treat command output as the gate; do not replace `BLOCK` or non-zero results with narrative judgment
15
+ - if the primary recommended route is still `/dv:breakdown`, keep refining `proposal.md` and specs instead of forcing design
16
+ - do not move to `/dv:design` until the command-backed checks stop blocking
17
+
10
18
  Output should move the work toward:
11
19
  - `proposal.md`
12
20
  - `specs/<capability>/spec.md`
@@ -7,11 +7,27 @@ Use the `da-vinci` skill for this request.
7
7
 
8
8
  Action: `build`
9
9
 
10
+ Before broad implementation when shell access is available:
11
+ - run `da-vinci workflow-status --project <path> [--change <id>] --json`
12
+ - run `da-vinci next-step --project <path> [--change <id>]`
13
+ - if the primary recommended route is not `/dv:build`, stop and continue from that route instead of forcing implementation
14
+ - run `da-vinci lint-spec --project <path> [--change <id>]`
15
+ - run `da-vinci scope-check --project <path> [--change <id>]`
16
+ - if `tasks.md` exists, run `da-vinci lint-tasks --project <path> [--change <id>]`
17
+ - if both `pencil-design.md` and `pencil-bindings.md` exist, run `da-vinci lint-bindings --project <path> [--change <id>]`
18
+ - inspect `executionProfile` and discipline blockers from `da-vinci next-step --project <path> [--change <id>] --json`
19
+ - if profile mode is `bounded_parallel`, run `da-vinci worktree-preflight --project <path> [--change <id>]` and downgrade to serial unless isolation is ready or explicitly accepted
20
+ - treat command output as the gate; do not downgrade `BLOCK` or non-zero results into soft guidance
21
+ - treat any `BLOCK` or missing required planning/design artifact as a hard stop before broad implementation
22
+
10
23
  Implementation rules:
11
24
  - requirements decide behavior
12
25
  - Pencil decides presentation
13
26
  - run `execution checkpoint` after each top-level task group
27
+ - persist per-task implementer evidence via `da-vinci task-execution --project <path> --change <id> --task-group <id> --status <...> --summary <...>`
28
+ - persist ordered review evidence via `da-vinci task-review --project <path> --change <id> --task-group <id> --stage spec ...` then `--stage quality ...`
14
29
  - treat `BUILD SUCCESSFUL` as compile-only evidence, not workflow completion
15
30
  - do not report `design complete` or `workflow complete` while in-scope task groups remain unfinished
31
+ - do not use terminal completion wording without fresh verification evidence
16
32
  - before any terminal completion claim, require `da-vinci audit --mode completion --change <change-id> <project-path>` to pass
17
33
  - if completion audit fails, continue from the minimal unfinished stage instead of exiting
@@ -23,14 +23,18 @@ Route discipline:
23
23
  - treat this route as prompt-first orchestration; do not assume a standalone CLI `continue` command exists
24
24
  - when shell access is available, run `da-vinci workflow-status --project <path> [--change <id>] --json` before deciding the primary continuation route
25
25
  - use `da-vinci next-step --project <path> [--change <id>]` as the first routing signal
26
+ - prefer `da-vinci next-step --project <path> [--change <id>] --json` when available so discipline markers, execution profile hints, and verification freshness are explicit
26
27
  - run `da-vinci scope-check --project <path> [--change <id>]` when page/state propagation looks ambiguous
27
28
  - do not restart discovery if the current artifacts already contain enough truth
28
29
  - determine route selection from artifact and checkpoint truth before reading contextual deltas
29
30
  - if workflow-status or next-step output is missing, stale, or unavailable, fall back to artifact scanning and checkpoint evidence
30
31
  - use contextual deltas as auxiliary recovery context only; they must not override route selection
31
32
  - if contextual deltas conflict with current artifacts, ignore them for routing and call out the conflict
33
+ - if design approval discipline markers are missing, malformed, or stale, keep routing in design/task refinement rather than promoting directly into implementation
32
34
  - do not default the user into `/prompts:dv-build` unless the project is clearly implementation-ready
33
35
  - if design artifacts exist but `tasks.md` does not, prefer a continuation prompt that moves into `/prompts:dv-tasks`
34
36
  - only prefer `/prompts:dv-build` once task generation and implementation readiness are already clear
35
37
  - do not route into `/prompts:dv-build` when any design gate is unresolved: missing shell-visible project-local `.pen`, active/unclosed Pencil session, runtime/design-source checkpoint still BLOCK, or required design-supervisor review still BLOCK/unaccepted
38
+ - if bounded-parallel execution is hinted, include `da-vinci worktree-preflight --project <path> [--change <id>]` before emitting a parallel implementation continuation prompt
39
+ - avoid terminal completion wording unless fresh verification evidence and completion audit requirements are explicit
36
40
  - continuation prompts should usually target the main workflow entry so Da Vinci can resume the full state machine
@@ -14,10 +14,13 @@ Output should move the work toward:
14
14
  Use Pencil-backed structure as the design source when available.
15
15
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
16
16
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
17
- Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci pencil-session persist`, and `da-vinci pencil-session end`.
17
+ Require the session wrapper commands on autonomous runs: `da-vinci pencil-session begin`, `da-vinci save-current-design`, and `da-vinci pencil-session end`.
18
18
  Before the first Pencil edit, require `da-vinci pencil-session begin` so the registered project-local `.pen` is seeded and locked before editing starts.
19
19
  When multiple `.pen` sources exist (for example an external backup), run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before `pencil-session begin`. If hashes diverge, confirm source priority explicitly and sync the chosen source into the project-local `.pen` (for example `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`) before continuing edits.
20
- If a registered project-local `.pen` already exists, reopen it for continuity but persist a fresh live MCP snapshot back to that same path through `pencil-session persist` after material edits.
20
+ If a registered project-local `.pen` already exists, reopen it for continuity and use `da-vinci save-current-design --project <project-path>` after material edits.
21
+ Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; never treat `unavailable` as a successful save.
22
+ Use the lower-level `pencil-session persist` payload path only when the high-level save bridge is unavailable.
23
+ The MVP guarantee is bound source-path safety (`registered .pen`, session `penPath`, and active editor path converge), not exact window-instance identity before MCP exposes stable window/editor identifiers.
21
24
  After the first successful Pencil write, run `da-vinci audit --mode integrity <project-path>` before broad expansion continues.
22
25
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
23
26
  Screenshot review must record an explicit `PASS`, `WARN`, or `BLOCK` plus the issue list and revision outcome; "looks good" is not a valid review record.