@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
@@ -126,7 +126,7 @@ Use only Pencil-supported properties; do not use web-only props like flex or mar
126
126
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
127
127
  Run `da-vinci audit --mode integrity <project-path>` after that first successful Pencil write before broad expansion continues.
128
128
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
129
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
129
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; fall back to `pencil-session persist --nodes-file/--variables-file` only when the high-level save bridge is unavailable.
130
130
  Keep non-`.pen` workflow artifacts out of `.da-vinci/designs/`.
131
131
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
132
132
  Record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome; "looks good" is not enough.
@@ -164,7 +164,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
164
164
  For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
165
165
 
166
166
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
167
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits.
167
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
168
168
  Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
169
169
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
170
170
  Persist project-local Pencil files under .da-vinci/designs/.
@@ -199,7 +199,7 @@ Use the existing Da Vinci artifacts in this project.
199
199
  Do not restart discovery unless an artifact is missing or clearly wrong.
200
200
  Determine continuation routing from current artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
201
201
  If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
202
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
202
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; only fall back to lower-level payload persistence when the high-level save bridge is unavailable.
203
203
  If the redesign is complex, keep the anchor-first flow until the design checkpoint passes.
204
204
  If Pencil MCP is active and this session performs new Pencil writes, rerun the MCP runtime gate and record the refreshed result in `pencil-design.md`.
205
205
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
@@ -120,7 +120,7 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
120
120
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
121
121
  Run `da-vinci audit --mode integrity <project-path>` after the first successful Pencil write before broad expansion continues.
122
122
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
123
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
123
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; fall back to `pencil-session persist --nodes-file/--variables-file` only when the high-level save bridge is unavailable.
124
124
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
125
125
  Record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome; "looks good" is not enough.
126
126
  If `DA-VINCI.md` configures `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, using screenshots plus Pencil variables and the design theses as inputs. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
@@ -156,7 +156,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
156
156
  For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
157
157
 
158
158
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
159
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits.
159
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
160
160
  Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
161
161
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
162
162
  Persist project-local Pencil files under .da-vinci/designs/.
@@ -191,7 +191,7 @@ Use the existing Da Vinci artifacts in this project.
191
191
  Do not restart discovery unless an artifact is missing or clearly wrong.
192
192
  Determine continuation routing from current artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
193
193
  If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
194
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
194
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; only fall back to lower-level payload persistence when the high-level save bridge is unavailable.
195
195
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
196
196
  If Pencil MCP is active and this session performs new Pencil writes, rerun the MCP runtime gate and record the refreshed result in `pencil-design.md`.
197
197
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
@@ -121,7 +121,7 @@ Before non-trivial `batch_design` calls, preflight the Pencil operations when sh
121
121
  If the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds.
122
122
  Run `da-vinci audit --mode integrity <project-path>` after the first successful Pencil write before broad expansion continues.
123
123
  If Pencil MCP is active, run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
124
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits. Fall back to the lower-level `ensure-pen + write-pen + check-pen-sync` chain only when the session wrapper cannot be used.
124
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; fall back to `pencil-session persist --nodes-file/--variables-file` only when the high-level save bridge is unavailable.
125
125
  Write exported screenshots under `.da-vinci/changes/<change-id>/exports/` only.
126
126
  Record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome; "looks good" is not enough.
127
127
  If `DA-VINCI.md` configures `Design-supervisor reviewers`, run `design-supervisor review` after screenshot review, layout hygiene, and design checkpoint, using screenshots plus Pencil variables and the design theses as inputs. If `Require Supervisor Review: true`, treat missing, blocked, or unaccepted review results as blocking before broad expansion or terminal completion.
@@ -157,7 +157,7 @@ Design 1-3 anchor surfaces first, review screenshots, then expand.
157
157
  For each anchor surface, explain how the new composition differs structurally from the current layout and whether it is primarily HTML-referenced, partially HTML-referenced, or inferred.
158
158
 
159
159
  Before non-trivial `batch_design` calls, preflight the Pencil operations when shell access is available.
160
- Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits.
160
+ Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes.
161
161
  Run the MCP runtime gate after the first successful Pencil write and record it in `pencil-design.md`.
162
162
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
163
163
  Persist project-local Pencil files under .da-vinci/designs/.
@@ -192,7 +192,7 @@ Use the existing Da Vinci artifacts in this project.
192
192
  Do not restart discovery unless an artifact is missing or clearly wrong.
193
193
  Determine continuation routing from current artifact and checkpoint truth first, then use contextual checkpoint deltas only as auxiliary recovery notes.
194
194
  If a contextual delta conflicts with current artifacts, ignore that delta and record the conflict before continuing.
195
- Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material live edits; fall back to the lower-level `write-pen + check-pen-sync` path only when the session wrapper cannot be used.
195
+ Keep the registered project-local Pencil source under .da-vinci/designs/ as the design source of truth. If the resumed session will perform Pencil edits, require `da-vinci pencil-session begin --project <project-path> --pen <path>`, then use `da-vinci save-current-design --project <project-path>` after material live edits. Treat `saved`, `blocked`, and `unavailable` as distinct outcomes; only fall back to lower-level payload persistence when the high-level save bridge is unavailable.
196
196
  If the redesign is complex, continue from the approved anchor surfaces instead of restarting broad scaffolding.
197
197
  If Pencil MCP is active and this session performs new Pencil writes, rerun the MCP runtime gate and record the refreshed result in `pencil-design.md`.
198
198
  Before reporting `design complete` or `workflow complete`, require both the MCP runtime gate and `da-vinci audit --mode completion --change <change-id> <project-path>` to pass.
@@ -85,6 +85,12 @@ When design is mostly ready and implementation is next, use these checks:
85
85
  - use this when runtime spec quality is still uncertain
86
86
  - `da-vinci scope-check`
87
87
  - use this when page/state propagation across planning artifacts looks ambiguous
88
+ - `da-vinci lint-tasks`
89
+ - confirm task groups have discipline markers, exact ownership targets, execution intent, and verification commands
90
+ - `da-vinci lint-bindings`
91
+ - run this when `pencil-design.md` and `pencil-bindings.md` both exist so implementation landing evidence stays parseable
92
+ - `da-vinci worktree-preflight`
93
+ - run this before bounded-parallel execution to decide whether local worktree isolation is recommended
88
94
 
89
95
  If you are already inside the project root directory, `--project` is optional because the CLI falls back to `cwd`.
90
96
 
@@ -95,8 +101,17 @@ da-vinci workflow-status
95
101
  da-vinci next-step
96
102
  da-vinci lint-spec
97
103
  da-vinci scope-check
104
+ da-vinci lint-tasks
98
105
  ```
99
106
 
107
+ During implementation, persist machine-readable task evidence instead of relying on chat-only summaries:
108
+
109
+ - `da-vinci task-execution --project <path> --change <id> --task-group <id> --status <DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED> --summary <text> ...`
110
+ - `da-vinci task-review --project <path> --change <id> --task-group <id> --stage spec ...`
111
+ - `da-vinci task-review --project <path> --change <id> --task-group <id> --stage quality ...`
112
+
113
+ `quality` review is valid only after `spec` review has a `PASS` record for the same task group.
114
+
100
115
  ## After Pausing Midway
101
116
 
102
117
  The safest resume order is:
@@ -107,6 +122,7 @@ The safest resume order is:
107
122
  4. if planning propagation is unclear, run `da-vinci scope-check`
108
123
  5. if planning artifacts changed since the last stable snapshot, run `da-vinci generate-sidecars` and `da-vinci diff-spec`
109
124
  6. before terminal completion, run `da-vinci verify-bindings` and `da-vinci verify-coverage`
125
+ 7. if completion wording is needed, confirm `verify-coverage` freshness is current and run `da-vinci audit --mode completion --change <id> <project-path>`
110
126
 
111
127
  Resume should follow the artifacts, not old conversation state:
112
128
 
@@ -146,67 +162,74 @@ npx -p @xenonbyte/da-vinci-workflow da-vinci-tui
146
162
 
147
163
  The TUI provides:
148
164
 
149
- - command grouping by workflow phase
150
- - English and Chinese UI descriptions
151
- - current project path and change-id context at the top
152
- - preview commands before execution
153
- - one-key toggles for `--strict`, `--json`, and `--continue-on-error`
154
- - placeholder-aware editing for commands that still need specific paths like `<pen-path>`
165
+ - a scene-first landing screen with `Install & Uninstall`, `Current Status`, `Switch Work Item`, `Design Ops`, `Pre-Implementation Checks`, `Pre-Acceptance Checks`, and `Settings`
166
+ - guided compound flows for resume, implementation readiness, and completion validation
167
+ - `Design Ops` focuses on practical design operations (`Save Current Design`, `Sync Icon Library`, and `Visual Assist Preset`)
168
+ - `Install & Uninstall` provides three actions: `Status` (show `da-vinci status`), `Install` (install all supported platforms), and `Uninstall` (uninstall all supported platforms)
169
+ - English and Chinese chrome while keeping emitted Visual Assist content in canonical English
170
+ - project/change context in the header with minimal persistent chrome
171
+ - `Settings` keeps only `Language` and `Logs`
172
+ - project-local daily diagnostics under `Settings > Logs` (`.da-vinci/logs/YYYY-MM-DD.ndjson`)
155
173
 
156
- ### TUI Phase Map
174
+ ### TUI Scene Map
157
175
 
158
176
  ```mermaid
159
177
  flowchart TD
160
- A[Launch da-vinci tui] --> B[Set project path and change-id context]
161
- B --> C[Routing & Resume<br/>workflow-status / next-step]
162
- C --> D{Which phase is active?}
163
-
164
- D --> E[Planning & Drift<br/>lint-spec / scope-check / lint-tasks / lint-bindings / generate-sidecars / diff-spec / scaffold]
165
- D --> F[Visual & Review<br/>icon-sync / icon-search / supervisor-review]
166
- D --> G[Pen Files & Sync<br/>preflight-pencil / ensure-pen / write-pen / check-pen-sync / check-pen-baseline / sync-pen-source / snapshot-pen]
167
- D --> H[Pencil Session<br/>pencil-lock * / pencil-session begin|persist|end|status]
168
- D --> I[Verification & Completion<br/>verify-bindings / verify-implementation / verify-structure / verify-coverage / audit]
169
- D --> J[Setup & Tooling<br/>install / uninstall / status / validate-assets / bootstrap-project]
170
-
171
- E --> I
172
- F --> G
173
- G --> H
174
- H --> E
175
- I --> K{Ready to finish?}
176
- K -->|No| C
177
- K -->|Yes| L[Completion audit and terminal claim]
178
+ A[Launch da-vinci tui] --> B[Set project path and change context]
179
+ B --> C[Install & Uninstall<br/>status + install-all + uninstall-all]
180
+ B --> D[Current Status<br/>workflow-status + next-step summary]
181
+ B --> E[Switch Work Item<br/>pick an existing change]
182
+ B --> F[Design Ops<br/>icon sync + visual assist preset]
183
+ B --> G[Pre-Implementation Checks<br/>implementation readiness gate]
184
+ B --> H[Pre-Acceptance Checks<br/>verify-* chain]
185
+ B --> I[Settings<br/>language + logs]
178
186
  ```
179
187
 
180
188
  Use this as the quick mental model:
181
189
 
182
- - start from `Routing & Resume`
183
- - move into the phase that matches the current blockers
184
- - return to `Routing & Resume` whenever the workflow pauses or artifacts changed materially
185
- - only finish after the verification lane and completion audit are both clear
190
+ - start from the scene that matches the current operator moment
191
+ - let the scene entrypoints orchestrate the common checks first
192
+ - use `Current Status` when a workflow pauses or the next route is unclear
193
+ - finish only after `Pre-Acceptance Checks` is clear
194
+
195
+ Visual Assist Preset mapping (`Design Ops > Visual Assist Preset`):
196
+
197
+ - `Masterpiece` => `required reviewer signoff`
198
+ - `High Quality` => `advisory reviewer`
199
+ - `Normal` => `adapter-only`
200
+
201
+ Managed Visual Assist behavior:
202
+
203
+ - select platform first, then select one of 3 quality levels
204
+ - write canonical English output from `docs/visual-assist-presets/`
205
+ - replace only `## Visual Assist` in project-root `DA-VINCI.md`
206
+ - preserve unrelated sections and avoid duplicate `## Visual Assist` blocks
186
207
 
187
208
  Main keys:
188
209
 
189
210
  - `Up/Down` or `j/k`: move selection
190
- - `Enter` or `r`: run the selected command
191
- - `h`: inspect parameters for the selected command
192
- - `m`: edit the preview command first
211
+ - `Enter` or `r`: open selected scene / action
212
+ - `u/d`: page up / page down in long content views
213
+ - `g/G`: jump to top / bottom in long content views
193
214
  - `p`: change project path context
194
215
  - `c`: change or clear change-id context
195
216
  - `l`: toggle English / Chinese
217
+ - `t`: cycle between theme modes when auto-detection is wrong
196
218
  - `s`: toggle `--strict`
197
219
  - `J`: toggle `--json`
198
220
  - `e`: toggle `--continue-on-error`
199
221
  - `?`: open help
200
- - `q`: quit
222
+ - `Ctrl-C`: emergency exit
201
223
 
202
224
  Recommended TUI usage:
203
225
 
204
226
  1. launch the TUI from the project root
205
- 2. set or confirm project path and change-id in the header
206
- 3. start with `workflow-status`
207
- 4. run `next-step`
208
- 5. move into `lint-spec` / `scope-check` / `tasks` / `verify-*` as needed
209
- 6. for specialized Pencil commands, press `m` and fill the remaining placeholders before execution
227
+ 2. pick the workflow scene that matches your current moment
228
+ 3. set or confirm project path and change-id in the header
229
+ 4. use the scene entrypoints first (`Switch Work Item`, `Pre-Implementation Checks`, `Install & Uninstall`, `Pre-Acceptance Checks`) and use `Current Status` as the direct re-entry summary
230
+ 5. use `Design Ops > Visual Assist Preset` to select platform + quality and write managed `Visual Assist` blocks
231
+ 6. use `Install & Uninstall > Status` to inspect installation state, or run `Install`/`Uninstall` for all supported platforms in one step
232
+ 7. inspect/copy diagnostics from `Settings > Logs` when troubleshooting; keep logs as evidence only, not routing truth
210
233
 
211
234
  ## Practical Shortcuts
212
235
 
@@ -99,17 +99,19 @@ Expected flow:
99
99
  11. if the same anchor surface rolls back twice, switch to micro-batches of 6 or fewer operations until a clean schema-safe pass succeeds
100
100
  12. require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit so the registered `.pen` is seeded and the global Pencil lock is held
101
101
  13. when external or secondary `.pen` sources exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` before the new session write phase; if diverged, sync the chosen source into `<project-pen>` first
102
- 14. during live design work, use `da-vinci pencil-session persist --project <project-path> --pen <path> ...` after material edits, then end with `da-vinci pencil-session end ...`
103
- 15. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
104
- 16. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
105
- 17. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
106
- 18. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
107
- 19. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
108
- 20. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
109
- 21. bind routes and pages to Pencil screens
110
- 22. generate tasks aligned to the redesign slices
111
- 23. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
112
- 24. build and verify only after the completion gate can eventually pass
102
+ 14. during live design work, use `da-vinci save-current-design --project <project-path>` after material edits, then end with `da-vinci pencil-session end ...`
103
+ 15. treat `saved`, `blocked`, and `unavailable` as distinct outcomes; only `saved` means the design source was persisted
104
+ 16. if save returns `unavailable`, do not claim success; use the lower-level `pencil-session persist --nodes-file/--variables-file` path only when the high-level bridge is unavailable
105
+ 17. verify the registered project-local `.pen` path becomes shell-visible immediately after the first successful Pencil write
106
+ 18. run `da-vinci audit --mode integrity <project-path>` immediately after that first successful write
107
+ 19. if Pencil MCP is active, run the MCP runtime gate and record it in `pencil-design.md`
108
+ 20. run `design-source checkpoint` to confirm the registered project-local `.pen` path, the active Pencil source, and the shell-visible file all agree
109
+ 21. export screenshots only under `.da-vinci/changes/<change-id>/exports/`, never into `.da-vinci/designs/`
110
+ 22. record screenshot review with explicit `PASS` / `WARN` / `BLOCK`, issue list, and revision outcome before broad expansion
111
+ 23. bind routes and pages to Pencil screens
112
+ 24. generate tasks aligned to the redesign slices
113
+ 25. run `da-vinci audit --mode completion --change <change-id> <project-path>` before any terminal completion claim
114
+ 26. build and verify only after the completion gate can eventually pass
113
115
 
114
116
  ### Complex Android example
115
117
 
@@ -134,7 +136,8 @@ If the same anchor surface rolls back twice, switch to micro-batches of 6 or few
134
136
  Use only Pencil-supported properties; do not use web-only props like flex or margin.
135
137
  Require `da-vinci pencil-session begin --project <project-path> --pen <path>` before the first Pencil edit.
136
138
  When external or secondary `.pen` files exist, run `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>` first; if hashes diverge, sync the preferred source into `<project-pen>` before editing.
137
- 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 `da-vinci pencil-session persist`.
139
+ If a registered project-local `.pen` already exists, reopen it for continuity and save through `da-vinci save-current-design --project <project-path>`.
140
+ Treat `saved`, `blocked`, and `unavailable` as distinct outcomes. If `unavailable`, do not claim success and only then fall back to the lower-level `pencil-session persist` payload path.
138
141
  Verify the registered project-local `.pen` file exists as a shell-visible file after the first Pencil write.
139
142
  Run `da-vinci audit --mode integrity <project-path>` after that first successful Pencil write before broad expansion continues.
140
143
  Keep `.da-vinci/designs/` reserved for `.pen` files only.
@@ -201,7 +204,7 @@ If frontend-skill is available, use it as the primary visual adapter.
201
204
  If it is unavailable, fall back to native Da Vinci design rules and continue.
202
205
  Persist project-local Pencil files under .da-vinci/designs/.
203
206
  If no registered project-local `.pen` exists yet, seed it there before the first Pencil edit and keep subsequent live edits bound to that exact path.
204
- If a registered project-local `.pen` already exists, reopen it for continuity but overwrite it from the current MCP snapshot after material live edits.
207
+ If a registered project-local `.pen` already exists, reopen it for continuity and persist after material live edits through `da-vinci save-current-design --project <project-path>`.
205
208
  ```
206
209
 
207
210
  ## Icon-library helper example
@@ -30,6 +30,12 @@ This means:
30
30
  - project-local `.pen` files remain the design source of truth
31
31
  - implementation must stay traceable to both
32
32
 
33
+ Truth-versus-orchestration boundary:
34
+
35
+ - route and completion truth comes from artifacts, checkpoints, execution signals, and `audit`
36
+ - orchestration hints such as execution profiles and worktree preflight remain advisory guidance
37
+ - orchestration hints must never override explicit `BLOCK` truth from artifacts, checkpoints, or completion audit
38
+
33
39
  ## Main Flow
34
40
 
35
41
  1. Choose the correct mode.
@@ -60,6 +66,12 @@ Use these command surfaces to inspect route readiness before selecting the next
60
66
  - explicitly generates deterministic planning sidecars used by diff and downstream tooling
61
67
  - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
62
68
  - validates execution-chain evidence from bindings through implementation and structural coverage
69
+ - `da-vinci task-execution --project <path> --change <id> --task-group <id> --status <DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED> --summary <text> ...`
70
+ - persists normalized implementer evidence per task group so pause/resume routing can read unresolved blockers and concerns
71
+ - `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> --status <PASS|WARN|BLOCK> --summary <text> ...`
72
+ - persists ordered two-stage review evidence (`spec` before `quality`) and can append review records into `verification.md`
73
+ - `da-vinci worktree-preflight --project <path> [--change <id>] [--json]`
74
+ - runs advisory worktree isolation checks before bounded-parallel execution
63
75
  - `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
64
76
  - reports normalized planning deltas for spec/tasks/page-map/bindings sidecars to support safe continuation
65
77
 
@@ -157,6 +169,7 @@ Before mapping or implementation are treated as safe, Da Vinci runs:
157
169
 
158
170
  - `design-source checkpoint`
159
171
  - `MCP runtime gate` when Pencil MCP is active
172
+ - `da-vinci save-current-design --project <project-path>` after material live edits (high-level bound-source save path)
160
173
  - `da-vinci audit --mode integrity <project-path>` during active work
161
174
  - checkpoint-adjacent `Context Delta` notes in existing change artifacts
162
175
 
@@ -166,6 +179,7 @@ These checks verify that:
166
179
  - the active editor is the correct source
167
180
  - the shell-visible `.pen` exists
168
181
  - live snapshot and persisted snapshot are in sync
182
+ - high-level save outcomes are handled honestly (`saved` / `blocked` / `unavailable`)
169
183
  - recent execution context is recoverable without replacing artifact truth as the routing authority
170
184
 
171
185
  ### 6. Mapping
@@ -183,7 +197,11 @@ These checks verify that:
183
197
  After mapping passes:
184
198
 
185
199
  - generate `tasks.md`
200
+ - keep task groups parseable with discipline markers plus explicit file targets, execution intent, review intent, and verification commands
186
201
  - implement from requirements plus Pencil data
202
+ - inspect `executionProfile` from `workflow-status` or `next-step --json` before broad implementation
203
+ - if bounded parallelism is suggested, run `da-vinci worktree-preflight --project <path> [--change <id>]` and downgrade to serial when isolation is not ready
204
+ - persist per-task implementer and review evidence via `task-execution` and ordered `task-review` records
187
205
  - verify requirement drift and design drift
188
206
 
189
207
  ### 8. Terminal Completion
@@ -193,6 +211,7 @@ The workflow must not report `design complete`, `workflow complete`, or any equi
193
211
  - design checkpoint is no longer blocking
194
212
  - design-source checkpoint is at least `PASS`
195
213
  - MCP runtime gate is acceptable when Pencil MCP was used
214
+ - fresh verification evidence is present for in-scope implementation and coverage claims
196
215
  - `da-vinci audit --mode completion --change <change-id> <project-path>` passes
197
216
 
198
217
  Notes:
@@ -45,10 +45,11 @@ Da Vinci 期望它们遵循工作流状态。
45
45
  - 当真正难记的是命令面而不是流程本身时,优先用它
46
46
  - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
47
47
  - 从工件和 checkpoint 真相推导当前 workflow 阶段
48
- - 报告 blocker、warning、handoff gate 状态,以及主推荐路由
48
+ - 报告 blocker、warning、handoff gate、discipline marker、execution profile 提示与 verification freshness
49
49
  - 它和 `audit` 职责不同:它负责选路,不是终态审计真相
50
50
  - `da-vinci next-step --project <path> [--change <id>] [--json]`
51
51
  - 基于同一套 workflow-state 推导,给出 route-first 的续跑建议
52
+ - JSON 输出包含 `nextStep`、`executionProfile`、`worktreePreflight` 与 discipline/freshness 元数据
52
53
  - 在自由扫描工件之前,优先把它作为第一路由信号
53
54
  - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
54
55
  - 校验 Da Vinci 运行时 `spec.md` 的核心章节(`Behavior`、`States`、`Inputs`、`Outputs`、`Acceptance`、`Edge Cases`)
@@ -59,7 +60,7 @@ Da Vinci 期望它们遵循工作流状态。
59
60
  - 输出页面与状态两条线的机器可读覆盖矩阵
60
61
  - 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
61
62
  - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
62
- - 校验顶层 task groups、编号顺序、verification 动作和 behavior 覆盖提示
63
+ - 校验顶层 task groups、编号顺序、discipline markers、执行模式提示、文件目标、verification 命令与 behavior 覆盖提示
63
64
  - 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
64
65
  - `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
65
66
  - 校验实现到 Pencil 的映射是否可解析、source 形态是否合理、实现落点是否可定位
@@ -70,6 +71,12 @@ Da Vinci 期望它们遵循工作流状态。
70
71
  - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
71
72
  - 校验代码落点、计划状态实现证据、以及绑定驱动的结构一致性
72
73
  - `verify-structure` 会明确报告是 markup-backed 还是 heuristic fallback,并给出置信度
74
+ - `da-vinci task-execution --project <path> --change <id> --task-group <id> --status <DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED> --summary <text> [--changed-files <csv>] [--test-evidence <csv>] [--concerns <csv>] [--blockers <csv>] [--json]`
75
+ - 持久化结构化 implementer 执行结果包,作为 task 级执行证据
76
+ - `da-vinci task-review --project <path> --change <id> --task-group <id> --stage <spec|quality> --status <PASS|WARN|BLOCK> --summary <text> [--issues <csv>] [--reviewer <name>] [--write-verification] [--json]`
77
+ - 持久化有序两阶段 task review 证据(`spec` 在前,`quality` 在后)
78
+ - `da-vinci worktree-preflight --project <path> [--change <id>] [--json]`
79
+ - 运行 advisory worktree 隔离预检(目录 ignore 安全、工作区脏状态、baseline 检查启发)
73
80
  - `da-vinci diff-spec --project <path> [--change <id>] [--from <sidecars-dir>] [--json]`
74
81
  - 比较规范化 planning sidecars,报告新增/删除/修改的规划项
75
82
  - 在同一 surface 下提供 spec 差异以及 tasks/page-map/bindings 摘要差异
@@ -101,6 +108,11 @@ Da Vinci 期望它们遵循工作流状态。
101
108
  - `da-vinci sync-pen-source --from <preferred-source> --to <project-pen>`
102
109
  - 把被选中的最新 `.pen` 来源同步到项目内 `.pen` 路径,并刷新 Da Vinci state 元数据
103
110
  - 当外部备份是最新基线时,在 `pencil-session begin` 前先执行
111
+ - `da-vinci save-current-design --project <path> [--json] [--continue-on-error]`
112
+ - 运行高层绑定源保存流程,作为 guided 设计持久化主路径
113
+ - 持久化前必须确认 registered `.pen`、session `penPath`、active editor path 收敛到同一来源
114
+ - 统一返回 `saved` / `blocked` / `unavailable`
115
+ - `blocked` 表示保存契约失败(来源/锁/载荷);`unavailable` 表示 MCP bridge 或 runtime 抓取不可达
104
116
 
105
117
  建议在 `/dv:design` 阶段使用,尤其是在 anchor surface 的图标定稿前。
106
118
 
@@ -174,6 +186,14 @@ Da Vinci 期望它们遵循工作流状态。
174
186
 
175
187
  这一层负责塑造行为真相。
176
188
 
189
+ 需求拆解阶段自检:
190
+
191
+ - 在把 requirements 交给设计前,先跑 `da-vinci workflow-status --project <path> [--change <id>] --json`
192
+ - 再跑 `da-vinci next-step --project <path> [--change <id>]`
193
+ - 跑 `da-vinci lint-spec --project <path> [--change <id>] --strict`
194
+ - 把命令结果当成门禁,不要把 `BLOCK` 或非零退出码解释成软建议
195
+ - 如果主推荐路由仍然是 `/dv:breakdown`,就继续修 `proposal.md` 和 specs,不要硬推进到 `/dv:design`
196
+
177
197
  ### `/dv:design`
178
198
 
179
199
  适合:
@@ -210,6 +230,14 @@ Da Vinci 期望它们遵循工作流状态。
210
230
 
211
231
  这一层只做实现拆解,不写代码。
212
232
 
233
+ 任务阶段自检:
234
+
235
+ - 在把工作移交给实现前,先跑 `task checkpoint`
236
+ - 有 shell 能力时,跑 `da-vinci lint-tasks --project <path> [--change <id>]`
237
+ - 如果 `pencil-design.md` 和 `pencil-bindings.md` 都存在,再跑 `da-vinci lint-bindings --project <path> [--change <id>]`
238
+ - 把命令结果当成门禁,不要把 `BLOCK` 或非零退出码降级成软提示
239
+ - 只要任务覆盖或 bindings 就绪度仍然阻塞,就不要推进到 `/dv:build`
240
+
213
241
  ### `/dv:build`
214
242
 
215
243
  适合:
@@ -225,10 +253,27 @@ Da Vinci 期望它们遵循工作流状态。
225
253
 
226
254
  这一层才是真正的执行阶段。
227
255
 
256
+ 实现阶段自检:
257
+
258
+ - 在大范围实现前,先跑 `da-vinci workflow-status --project <path> [--change <id>] --json`
259
+ - 再跑 `da-vinci next-step --project <path> [--change <id>]`
260
+ - 如果主推荐路由不是 `/dv:build`,就停止并回到那个路由,而不是硬做实现
261
+ - 跑 `da-vinci lint-spec --project <path> [--change <id>]`
262
+ - 跑 `da-vinci scope-check --project <path> [--change <id>]`
263
+ - 如果 `tasks.md` 已存在,跑 `da-vinci lint-tasks --project <path> [--change <id>]`
264
+ - 如果 `pencil-design.md` 和 `pencil-bindings.md` 都存在,跑 `da-vinci lint-bindings --project <path> [--change <id>]`
265
+ - 查看 `da-vinci next-step --project <path> [--change <id>] --json` 的 `executionProfile`
266
+ - 若 profile 为 `bounded_parallel`,先跑 `da-vinci worktree-preflight --project <path> [--change <id>]`;隔离未就绪则降级串行
267
+ - 用 `da-vinci task-execution ...` 持久化每个 task group 的 implementer 结果包,确保 concern/blocker 可追踪
268
+ - 按顺序执行 task review:先 `da-vinci task-review ... --stage spec ...`,再 `da-vinci task-review ... --stage quality ...`
269
+ - 把命令结果当成门禁,不要把 `BLOCK` 或非零退出码降级成软提示
270
+ - 只要还有 `BLOCK` 或缺少必要 planning/design 工件,就不要进入大范围实现
271
+
228
272
  完成判定规则:
229
273
 
230
274
  - `BUILD SUCCESSFUL` 只代表可编译,不代表 workflow 完成
231
275
  - 只要 in-scope task groups 还没做完,就不能宣告 `design complete` 或 `workflow complete`
276
+ - 终态 completion 表述前必须具备 fresh verification evidence
232
277
  - 任何终态声明前都要运行 `da-vinci audit --mode completion --change <change-id> <project-path>` 并通过
233
278
 
234
279
  ### `/dv:verify`
@@ -245,6 +290,18 @@ Da Vinci 期望它们遵循工作流状态。
245
290
 
246
291
  这一层是 truth reconciliation 阶段。
247
292
 
293
+ 验证阶段自检:
294
+
295
+ - 有 shell 能力时,跑 `da-vinci verify-bindings --project <path> [--change <id>]`
296
+ - 跑 `da-vinci verify-implementation --project <path> [--change <id>]`
297
+ - 跑 `da-vinci verify-structure --project <path> [--change <id>]`
298
+ - 跑 `da-vinci verify-coverage --project <path> [--change <id>]`
299
+ - 把命令结果当成门禁,不要把 `BLOCK` 或 `FAIL` 降级成软提示
300
+ - 只要任何验证面仍然是 `BLOCK` 或 `FAIL`,就继续停留在验证阶段并记录 drift,而不是宣称成功
301
+ - 终态表述前要求 `verify-coverage` 和 `workflow-status` 中的验证证据 freshness 为最新
302
+ - 如果启用了 task-review 证据,存在未解决 `WARN/BLOCK` 评审阶段时不得关闭对应 task group
303
+ - 如果要声称终态完成,先要求 `da-vinci audit --mode completion --change <change-id> <project-path>` 通过
304
+
248
305
  ## 基于状态的下一步规则
249
306
 
250
307
  这就是当前应该给用户的推荐逻辑。
@@ -44,3 +44,26 @@ Audit 集成:
44
44
  - MVP 不做多框架扩展
45
45
  - scaffold 边界来自 `pencil-bindings.md` 映射
46
46
  - 接受前需跑 `verify-bindings`、`verify-implementation`、`verify-structure`
47
+
48
+ ## 5. 下一阶段规划升级:Discipline And Orchestration
49
+
50
+ execution-chain 能力落地后,下一项规划中的升级是:
51
+
52
+ - `openspec/changes/discipline-and-orchestration-upgrade/`
53
+
54
+ 该规划变更会补充:
55
+
56
+ - 实施前交接纪律的强化
57
+ - `tasks.md` 执行就绪质量检查强化
58
+ - 与 workflow state 绑定的有边界编排提示
59
+ - 结构化 task 执行与审查证据
60
+ - 基于 fresh verification evidence 的 completion 表述约束
61
+ - 可选 worktree preflight 隔离建议
62
+
63
+ 重要边界:
64
+
65
+ - 该升级不会替代 artifact truth、checkpoint truth 或 completion-audit 权威
66
+
67
+ 参考:
68
+
69
+ - `docs/discipline-and-orchestration-upgrade.md`
@@ -239,7 +239,8 @@ Da Vinci 应该:
239
239
  - 如果已有项目内 `.pen` 文件,优先登记 `.da-vinci/designs/` 下的路径
240
240
  5. 生成 `pencil-design.md` 增量
241
241
  - 必须通过 `da-vinci pencil-session begin` 开始这轮设计,让登记路径先 seed 好并拿到锁
242
- - 如果项目里原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后优先通过 `da-vinci pencil-session persist` 把当前 MCP 快照重新覆盖写回同一路径
242
+ - 如果项目里原本已有 `.pen`,继续设计时先打开它,但发生实质性 live edit 后优先执行 `da-vinci save-current-design --project <project-path>`
243
+ - 必须区分 `saved`、`blocked`、`unavailable` 三类结果;只有高层桥接 `unavailable` 时,才退回 `pencil-session persist --nodes-file/--variables-file` 的底层链路
243
244
  6. 更新 `pencil-bindings.md`
244
245
  7. 生成 `tasks.md`
245
246
  8. 进入实现
@@ -31,7 +31,7 @@ PNG 只是审查产物,不是设计真相源。
31
31
  Da Vinci 现在要求自治运行使用这组 session wrapper:
32
32
 
33
33
  - `da-vinci pencil-session begin`
34
- - `da-vinci pencil-session persist`
34
+ - `da-vinci save-current-design`
35
35
  - `da-vinci pencil-session end`
36
36
 
37
37
  这组 wrapper 的作用,是把下面三件事变成强制步骤:
@@ -77,18 +77,21 @@ Da Vinci 不会假设 live MCP 编辑已经被自动刷盘。
77
77
 
78
78
  Da Vinci 不把 headless interactive `save()` 当作权威持久化真相。
79
79
 
80
- 正式持久化步骤是:
80
+ 主路径持久化步骤是:
81
81
 
82
- 1. 读取 MCP 可读的 node snapshot
83
- 2. 读取 MCP 可读的 variable snapshot
84
- 3. 写项目内 `.pen`
85
- 4. reopen 校验
86
- 5. 比较 live snapshot hash persisted snapshot hash
82
+ 1. 执行 `da-vinci save-current-design --project <project-path>`
83
+ 2. 明确读取结果包:`saved` / `blocked` / `unavailable`
84
+ 3. 只有 `saved` 才表示持久化成功
85
+ 4. `blocked` 表示保存时的来源/锁/载荷契约失败
86
+ 5. `unavailable` 表示 MCP bridge runtime 抓取不可达,不能当成“已保存”
87
87
 
88
88
  相关命令:
89
89
 
90
- - `da-vinci write-pen`
91
- - `da-vinci check-pen-sync`
90
+ - 高层主路径:`da-vinci save-current-design`
91
+ - 底层回退路径:`da-vinci pencil-session persist`、`da-vinci write-pen`、`da-vinci check-pen-sync`
92
+
93
+ MVP 安全保证仅覆盖“来源路径收敛”:registered `.pen`、session `penPath`、active editor path 必须收敛到同一文件。
94
+ 在 MCP 暴露稳定 window/editor 标识前,精确窗口实例绑定仍是非目标。
92
95
 
93
96
  `da-vinci snapshot-pen` 只用于 disk-to-disk,不是 live 编辑持久化路径。
94
97
 
@@ -253,7 +256,7 @@ Context Delta 相关审计期望都是告警级:
253
256
  1. `da-vinci pencil-session begin --project <project-path> --pen <path>`
254
257
  2. 如果存在外部/次要 `.pen`,在编辑前先运行 `da-vinci check-pen-baseline --pen <project-pen> --baseline <other-pen>`;若分叉,先把优先来源同步回 `<project-pen>`
255
258
  3. Pencil MCP 编辑
256
- 4. `da-vinci pencil-session persist --project <project-path> --pen <path> --nodes-file <nodes.json> --variables-file <vars.json> --version <version>`
259
+ 4. `da-vinci save-current-design --project <project-path>`
257
260
  5. screenshot review + layout hygiene
258
261
  6. design checkpoint
259
262
  7. 如果配置了,就执行 design-supervisor review
@@ -280,13 +283,13 @@ flowchart TD
280
283
  K -- 否 --> F
281
284
  K -- 是 --> L{是否配置了 design-supervisor review?}
282
285
  L -- 是 --> M[执行 design-supervisor review,结合 screenshots 与 theme inputs]
283
- L -- 否 --> N[pencil-session persist live MCP 快照写回 .pen]
286
+ L -- 否 --> N[save-current-design 把绑定的 live 快照写回 .pen]
284
287
  M --> O{是否要求 Supervisor Review?}
285
288
  O -- 否 --> N
286
289
  O -- 是 --> P{review 为 PASS 或已接受 WARN?}
287
290
  P -- 否 --> F
288
291
  P -- 是 --> N
289
- N --> Q[check-pen-sync 校验 live hash 与 persisted hash 一致]
292
+ N --> Q[save-current-design 返回 saved 或终态 blocked/unavailable]
290
293
  Q --> R{design-source checkpoint 和 runtime gate 通过?}
291
294
  R -- 否 --> F
292
295
  R -- 是 --> S{是否还要继续设计?}