@xenonbyte/da-vinci-workflow 0.2.4 → 0.2.6

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 (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +15 -9
  3. package/README.zh-CN.md +16 -9
  4. package/SKILL.md +45 -704
  5. package/docs/dv-command-reference.md +33 -5
  6. package/docs/execution-chain-migration.md +14 -3
  7. package/docs/maintainer-bootstrap.md +102 -0
  8. package/docs/pencil-rendering-workflow.md +1 -1
  9. package/docs/prompt-entrypoints.md +1 -0
  10. package/docs/skill-contract-maintenance.md +14 -0
  11. package/docs/skill-usage.md +31 -0
  12. package/docs/workflow-overview.md +40 -5
  13. package/docs/zh-CN/dv-command-reference.md +31 -5
  14. package/docs/zh-CN/maintainer-bootstrap.md +101 -0
  15. package/docs/zh-CN/pencil-rendering-workflow.md +1 -1
  16. package/docs/zh-CN/prompt-entrypoints.md +1 -0
  17. package/docs/zh-CN/skill-usage.md +30 -0
  18. package/docs/zh-CN/workflow-overview.md +38 -5
  19. package/lib/audit.js +19 -0
  20. package/lib/cli/helpers.js +104 -0
  21. package/lib/cli/lint-family.js +56 -0
  22. package/lib/cli/verify-family.js +79 -0
  23. package/lib/cli.js +143 -172
  24. package/lib/gate-utils.js +56 -0
  25. package/lib/install.js +134 -6
  26. package/lib/lint-bindings.js +41 -28
  27. package/lib/lint-spec.js +403 -109
  28. package/lib/lint-tasks.js +571 -21
  29. package/lib/maintainer-readiness.js +317 -0
  30. package/lib/planning-parsers.js +198 -2
  31. package/lib/planning-quality-utils.js +81 -0
  32. package/lib/planning-signal-freshness.js +205 -0
  33. package/lib/scaffold.js +454 -23
  34. package/lib/scope-check.js +751 -82
  35. package/lib/sidecars.js +396 -1
  36. package/lib/task-review.js +2 -1
  37. package/lib/utils.js +34 -0
  38. package/lib/verify.js +1160 -88
  39. package/lib/workflow-persisted-state.js +52 -32
  40. package/lib/workflow-state.js +1187 -249
  41. package/package.json +1 -1
  42. package/references/skill-workflow-detail.md +66 -0
@@ -9,7 +9,10 @@ Use it when you need to know:
9
9
  - how the routes connect in normal delivery
10
10
  - what to do when `verify` finds drift
11
11
 
12
- Use [workflow-overview.md](/Users/xubo/x-skills/da-vinci/docs/workflow-overview.md) for the full end-to-end workflow and [pencil-rendering-workflow.md](/Users/xubo/x-skills/da-vinci/docs/pencil-rendering-workflow.md) for the dedicated Pencil rendering lifecycle.
12
+ Use [workflow-overview.md](./workflow-overview.md) for the full end-to-end workflow and [pencil-rendering-workflow.md](./pencil-rendering-workflow.md) for the dedicated Pencil rendering lifecycle.
13
+ If you are contributing to this repository itself, use
14
+ [maintainer-bootstrap.md](./maintainer-bootstrap.md)
15
+ as the canonical maintainer bootstrap path before choosing deeper command surfaces.
13
16
 
14
17
  ## Core Idea
15
18
 
@@ -41,24 +44,37 @@ These commands do not replace route selection, but they support design execution
41
44
  - opens a workflow-oriented terminal UI that groups commands by phase and lets you run them after previewing the generated CLI
42
45
  - use `da-vinci-tui` as the dedicated bin alias, or `npx -p @xenonbyte/da-vinci-workflow da-vinci tui` without a global install
43
46
  - useful when the command surface is harder to remember than the workflow itself
47
+ - `da-vinci verify-install [--platform <value>] [--json]`
48
+ - checks install confidence for explicitly selected maintainer platforms (for example `codex` only)
49
+ - treats non-selected platforms as `out_of_scope` / degraded coverage instead of hard failure
50
+ - if `--platform` is omitted, scope is reported as unknown instead of guessed from missing assets
51
+ - `da-vinci maintainer-readiness [--platform <value>] [--project <path>] [--json]`
52
+ - canonical repository-maintainer readiness surface (diagnosis), distinct from setup/bootstrap
53
+ - combines packaged-asset validation, verify-install confidence, and focused contracts lane (`npm run quality:ci:contracts`)
54
+ - reports actionable next steps and keeps deeper lanes (`quality:ci:e2e`, `quality:ci`) as optional escalation
55
+ - intentionally narrower than full CI; escalate to deeper lanes when risk is higher
44
56
  - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
45
57
  - derives the current workflow stage from artifact and checkpoint truth
46
58
  - reports blockers, warnings, handoff-gate state, discipline markers, execution profile hints, and verification-evidence freshness
47
59
  - keep this distinct from `audit`: route guidance is not completion truth
48
60
  - `da-vinci next-step --project <path> [--change <id>] [--json]`
49
61
  - provides a route-first continuation summary from the same derived workflow state
50
- - JSON output includes `nextStep`, `executionProfile`, `worktreePreflight`, and discipline/freshness metadata for orchestration consumers
62
+ - JSON output includes `nextStep`, `blockingGate`, `executionProfile`, `worktreePreflight`, and discipline/freshness metadata for orchestration consumers
51
63
  - use this as the first continuation signal before free-form artifact scanning
52
64
  - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
53
65
  - validates Da Vinci runtime `spec.md` schema sections (`Behavior`, `States`, `Inputs`, `Outputs`, `Acceptance`, `Edge Cases`)
66
+ - emits machine-readable planning gates in JSON: `gates.principleInheritance`, `gates.clarify`, `gates.scenarioQuality`
67
+ - bounded-only clarify findings remain visible in `gates.clarify.bounded` and notes, and are non-blocking by default when bounded metadata is complete
54
68
  - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
55
69
  - explicitly does not treat OpenSpec planning `ADDED Requirements` structure as runtime-spec validity
56
70
  - `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
57
71
  - checks proposal, page-map, runtime specs, pencil-design states, and tasks for scope propagation gaps
72
+ - emits machine-readable analyze gate output in JSON: `gates.analyze`
58
73
  - emits a machine-readable coverage matrix for pages and states
59
74
  - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
60
75
  - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
61
76
  - validates top-level task groups, ordering, discipline markers, execution-mode hints, file targets, verification commands, and behavior-to-task coverage hints
77
+ - validates task-anchor syntax (`Planning anchors:` and `anchor:<ref>`) and emits machine-readable checkpoint gate output: `gates.taskCheckpoint`
62
78
  - default behavior is advisory (`WARN` with zero exit); `--strict` upgrades findings to blocking
63
79
  - `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
64
80
  - validates implementation-to-Pencil mappings for parseability, source shape, and implementation landings
@@ -66,9 +82,21 @@ These commands do not replace route selection, but they support design execution
66
82
  - `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
67
83
  - explicitly generates deterministic planning sidecars: `spec.index.json`, `tasks.index.json`, `page-map.index.json`, `bindings.index.json`
68
84
  - this is the only write surface for planning sidecars; lint/status/verify surfaces should not silently rewrite them
69
- - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
70
- - verifies code landings, planned-state implementation evidence, and structural consistency against bindings
71
- - `verify-structure` reports whether checks used markup-backed analysis or heuristic fallback and exposes confidence
85
+ - `da-vinci verify-bindings --project <path> [--change <id>] [--strict] [--json]`
86
+ - validates implementation landing resolution from `pencil-bindings.md`
87
+ - `da-vinci verify-implementation --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
88
+ - verifies planned-state/task-group implementation evidence with per-check `mode` + `confidence` metadata
89
+ - JS/TS checks are syntax-aware and do not count comment-only or string-literal-only matches as normal coverage
90
+ - when `--changed-files` is used, the run is explicit incremental scope (partial semantics) and reports selected/scanned/filtered file counts
91
+ - `da-vinci verify-structure --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
92
+ - verifies structural consistency against bindings and reports `markup` vs `heuristic` confidence surfaces
93
+ - when `--changed-files` is used, unmatched or irrelevant entries stay visible instead of silently widening to full scan
94
+ - `da-vinci verify-coverage --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
95
+ - aggregates upstream verification surfaces and marks incremental upstream results as partial freshness
96
+ - `da-vinci scaffold --project <path> [--change <id>] [--output <path>] [--json]`
97
+ - generates reviewable TODO scaffold templates with framework-aware shape (`next`/`react`/`vue`/`svelte`/`html`)
98
+ - keeps known implementation landing extension/route shape when a concrete landing already exists
99
+ - unknown/ambiguous framework detection falls back to HTML with explicit warning; traversal/output-root safety remains enforced
72
100
  - `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]`
73
101
  - persists normalized implementer-status envelopes into execution signals
74
102
  - use this to keep resume routing machine-readable when implementation is blocked or concerns remain
@@ -30,10 +30,21 @@ Audit integration:
30
30
 
31
31
  - state schema version is supported
32
32
  - change entry exists
33
- - state timestamp is fresh
34
- - fingerprint matches current artifact truth
33
+ - governing artifact content digests match current artifact truth
35
34
 
36
- If any check fails, Da Vinci falls back to derived state from artifacts and records reconciliation notes.
35
+ Task-group ownership is now split cleanly:
36
+
37
+ - `.da-vinci/state/workflow.json` is the route-cache snapshot
38
+ - `.da-vinci/state/task-groups/<change>.json` is the canonical persisted task-group runtime-state file
39
+ - `workflow.json` references the canonical task-group file by path and digest instead of embedding a normal-copy `taskGroups` array
40
+
41
+ If persisted route trust fails, Da Vinci falls back to derived state from artifacts and records reconciliation notes.
42
+ If the canonical task-group file is missing, unreadable, or digest-mismatched, Da Vinci keeps the persisted route snapshot eligible but rebuilds task-group runtime state from artifacts for that read.
43
+
44
+ Snapshot age is now advisory only:
45
+
46
+ - an old snapshot remains usable when governing artifact digests still match
47
+ - age alone no longer invalidates persisted route truth
37
48
 
38
49
  ## 4. Scaffold Constraints
39
50
 
@@ -0,0 +1,102 @@
1
+ # Maintainer Bootstrap Guide
2
+
3
+ This guide is the canonical entry for contributors working on Da Vinci itself.
4
+
5
+ ## Audience Boundary
6
+
7
+ - Repository maintainer bootstrap: preparing to change this repository.
8
+ - Target-project bootstrap: `da-vinci bootstrap-project` scaffolds `.da-vinci/` artifacts for another project.
9
+ - Package install status: `da-vinci status` / `da-vinci verify-install` checks install confidence only, not full repo readiness.
10
+ - Operator workflow execution: use operator docs for downstream project flow, not for repository bootstrap.
11
+
12
+ ## First 10 Minutes After Clone
13
+
14
+ 1. Install dependencies: `npm install`
15
+ 2. Validate packaged assets: `npm run validate-assets`
16
+ 3. Verify install scope explicitly (recommended): `da-vinci verify-install --platform codex`
17
+ 4. Run canonical repo readiness check: `da-vinci maintainer-readiness --platform codex`
18
+
19
+ Run these from the repository root checkout you are maintaining. If needed, pass
20
+ `--project <path>` to target a different checkout explicitly.
21
+
22
+ If you use multiple environments, pass all selected ones:
23
+
24
+ - `da-vinci verify-install --platform codex,claude`
25
+ - `da-vinci maintainer-readiness --platform codex,claude`
26
+
27
+ ## Entry Surface Taxonomy
28
+
29
+ - Canonical entry:
30
+ - this guide + `da-vinci maintainer-readiness`
31
+ - Secondary/advanced maintainer surfaces:
32
+ - `npm run quality:ci:contracts`
33
+ - `npm run quality:ci:e2e`
34
+ - `npm run quality:ci`
35
+ - targeted `scripts/test-*.js` runs when narrowing a regression
36
+ - Downstream-project surfaces (not repo bootstrap):
37
+ - `da-vinci bootstrap-project`
38
+ - project `.da-vinci/` artifact workflows
39
+ - Bootstrap-adjacent install surfaces:
40
+ - `da-vinci status`
41
+ - `da-vinci verify-install`
42
+
43
+ ## Bootstrap vs Diagnosis
44
+
45
+ - Bootstrap/setup answers: "How do I get ready to work here?"
46
+ - Diagnosis/readiness answers: "Is this repo + local environment healthy enough for my change?"
47
+
48
+ Canonical diagnosis surface:
49
+
50
+ - `da-vinci maintainer-readiness`
51
+
52
+ It is intentionally narrower than full CI and gives actionable next steps. It runs:
53
+
54
+ - packaged asset validation
55
+ - selected-platform verify-install confidence
56
+ - focused quality lane: `npm run quality:ci:contracts`
57
+
58
+ ## Selected Platform Semantics
59
+
60
+ - Explicit `--platform` means only selected platforms are blocking.
61
+ - Non-selected platforms remain visible as `out_of_scope` / degraded coverage.
62
+ - If no `--platform` is provided, scope is treated as unknown and reported as degraded coverage instead of hard failure.
63
+
64
+ ## Use This / Do Not Use This
65
+
66
+ - Use this:
67
+ - `da-vinci verify-install --platform codex` then `da-vinci maintainer-readiness --platform codex`
68
+ - Do not use this:
69
+ - `da-vinci status` alone as proof of repo readiness
70
+ - Use this:
71
+ - this maintainer guide for repository contribution setup
72
+ - Do not use this:
73
+ - `da-vinci bootstrap-project` as maintainer bootstrap for this repository
74
+ - Use this:
75
+ - operator docs only when you are running Da Vinci on another target project
76
+ - Do not use this:
77
+ - operator workflow docs as the first maintainer entry surface
78
+
79
+ ## Troubleshooting
80
+
81
+ - Symptom: `verify-install` is WARN with unknown scope.
82
+ - Action: rerun with explicit `--platform <value>` so selected scope is explicit.
83
+ - Symptom: `maintainer-readiness` is BLOCK on verify-install.
84
+ - Action: fix selected-platform install issues first, then rerun readiness.
85
+ - Symptom: install checks pass but change confidence is still low.
86
+ - Action: run deeper lanes (`quality:ci:e2e` or `quality:ci`) and targeted tests for the changed surfaces.
87
+ - Symptom: confusion between repo bootstrap and downstream project bootstrap.
88
+ - Action: keep repo bootstrap in this guide; use `bootstrap-project` only for downstream repositories.
89
+
90
+ ## Deeper Validation Lanes
91
+
92
+ Run these before broader or higher-risk changes:
93
+
94
+ - `npm run quality:ci:e2e`
95
+ - `npm run quality:ci`
96
+
97
+ ## Operator Workflow References
98
+
99
+ Operator-facing workflow docs remain separate:
100
+
101
+ - [skill-usage.md](./skill-usage.md)
102
+ - [workflow-overview.md](./workflow-overview.md)
@@ -10,7 +10,7 @@ Use it when you need the exact rules for:
10
10
  - screenshot review
11
11
  - runtime gates and filesystem audits
12
12
 
13
- Use [dv-command-reference.md](/Users/xubo/x-skills/da-vinci/docs/dv-command-reference.md) when you need the route-level `dv:` command sequence and rollback behavior across `design`, `tasks`, `build`, and `verify`.
13
+ Use [dv-command-reference.md](./dv-command-reference.md) when you need the route-level `dv:` command sequence and rollback behavior across `design`, `tasks`, `build`, and `verify`.
14
14
 
15
15
  ## Rendering Truth Model
16
16
 
@@ -71,6 +71,7 @@ Continuation precedence:
71
71
  - run `da-vinci scope-check --project <path> [--change <id>]` when page or state propagation across planning artifacts is uncertain
72
72
  - run `da-vinci lint-tasks --project <path> [--change <id>]` before routing into `build` when task metadata quality is uncertain
73
73
  - run `da-vinci verify-bindings --project <path> [--change <id>]` and `da-vinci verify-coverage --project <path> [--change <id>]` before terminal completion routing
74
+ - if using `--changed-files` with `verify-implementation`/`verify-structure`/`verify-coverage`, treat results as explicit incremental partial evidence, not full-project freshness
74
75
  - run `da-vinci diff-spec --project <path> [--change <id>]` after planning edits when continuation must reason about changed requirement slices
75
76
  - determine routing from artifact and checkpoint truth first
76
77
  - use contextual checkpoint deltas only as auxiliary recovery context
@@ -0,0 +1,14 @@
1
+ # SKILL Contract Maintenance
2
+
3
+ Use this policy when editing workflow guidance:
4
+
5
+ 1. Keep invariant route/execution truth in `SKILL.md` only.
6
+ 2. Keep stage-specific procedure in one owned reference file.
7
+ 3. Ensure `SKILL.md` `Load References On Demand` map points to that owner.
8
+ 4. Avoid duplicate prose across `SKILL.md`, `references/`, and generated command assets unless tests explicitly require duplication.
9
+ 5. Update `references/skill-workflow-detail.md` move map when relocating sections.
10
+
11
+ Boundary rule:
12
+
13
+ - If a rule changes workflow truth, route semantics, or execution policy, edit core.
14
+ - If a rule is tactical for one stage (design/build/review/scaffold), edit reference docs.
@@ -2,6 +2,10 @@
2
2
 
3
3
  Use this document when you want the operator-facing workflow rather than the lower-level command reference.
4
4
 
5
+ If you are contributing to Da Vinci itself, start with
6
+ [maintainer-bootstrap.md](./maintainer-bootstrap.md)
7
+ instead of this operator workflow guide.
8
+
5
9
  This guide focuses on:
6
10
 
7
11
  - how to enter the Da Vinci workflow the first time
@@ -18,6 +22,7 @@ That means:
18
22
  - `spec.md` and related requirement artifacts stay the behavior truth
19
23
  - the project-local `.pen` stays the design truth
20
24
  - `tasks.md`, `verification.md`, and execution signals explain what has or has not been implemented yet
25
+ - workflow memory is artifact-backed local state under `.da-vinci/state/`, not cross-chat memory
21
26
 
22
27
  ## First Entry
23
28
 
@@ -79,14 +84,20 @@ When design is mostly ready and implementation is next, use these checks:
79
84
 
80
85
  - `da-vinci workflow-status`
81
86
  - confirm the active stage and blockers first
87
+ - task-group focus comes from checklist progress plus the latest `task-execution` / `task-review` evidence
82
88
  - `da-vinci next-step`
83
89
  - confirm whether the next move should still be `design`, `tasks`, or `build`
90
+ - use this when you need the first runtime-aware task-group focus, not just the next unchecked checklist item
84
91
  - `da-vinci lint-spec`
85
92
  - use this when runtime spec quality is still uncertain
93
+ - check `gates.principleInheritance`, `gates.clarify`, and `gates.scenarioQuality` in `--json` output
94
+ - treat `gates.clarify.bounded` as visible planning context: bounded-only clarify is non-blocking by default when bounded metadata is complete
86
95
  - `da-vinci scope-check`
87
96
  - use this when page/state propagation across planning artifacts looks ambiguous
97
+ - check `gates.analyze` in `--json` output for cross-artifact coherence blockers
88
98
  - `da-vinci lint-tasks`
89
99
  - confirm task groups have discipline markers, exact ownership targets, execution intent, and verification commands
100
+ - check `gates.taskCheckpoint` in `--json` output for anchor and checkpoint readiness
90
101
  - `da-vinci lint-bindings`
91
102
  - run this when `pencil-design.md` and `pencil-bindings.md` both exist so implementation landing evidence stays parseable
92
103
  - `da-vinci worktree-preflight`
@@ -112,6 +123,13 @@ During implementation, persist machine-readable task evidence instead of relying
112
123
 
113
124
  `quality` review is valid only after `spec` review has a `PASS` record for the same task group.
114
125
 
126
+ Compatibility note:
127
+
128
+ - flat task-group fields such as `status`, `completion`, `nextAction`, and `resumeCursor` remain available in `workflow-status --json`
129
+ - `completion` stays checklist-derived progress percentage
130
+ - `status`, `nextAction`, and `resumeCursor` may shift to runtime-aware values when implementer or review evidence is fresher than checklist state
131
+ - `workflow-status --json` and `next-step --json` expose `blockingGate` when planning-gate promotion is blocked
132
+
115
133
  ## After Pausing Midway
116
134
 
117
135
  The safest resume order is:
@@ -124,12 +142,25 @@ The safest resume order is:
124
142
  6. before terminal completion, run `da-vinci verify-bindings` and `da-vinci verify-coverage`
125
143
  7. if completion wording is needed, confirm `verify-coverage` freshness is current and run `da-vinci audit --mode completion --change <id> <project-path>`
126
144
 
145
+ Strictness control:
146
+
147
+ - command lint strictness: use `--strict`
148
+ - workflow promotion strictness: use `DA_VINCI_DISCIPLINE_STRICT_PROMOTION`
149
+ - no separate strict controls are introduced for clarify/analyze/task-checkpoint gates
150
+ - integrity audit keeps bounded-only clarify context visible from planning signals even when `lint-spec` signal status is `PASS`
151
+
127
152
  Resume should follow the artifacts, not old conversation state:
128
153
 
129
154
  - if design artifacts exist but `tasks.md` does not, resume into `tasks`
130
155
  - if `tasks.md` exists but design gates are still unresolved, resume into design cleanup rather than `build`
131
156
  - only resume into `build` when implementation readiness is already clear
132
157
 
158
+ When task execution or review evidence conflicts with checklist progress:
159
+
160
+ - trust the route recommendation from `workflow-status` / `next-step`
161
+ - use task-group `nextAction` as the effective resume focus
162
+ - treat checklist `completion` as progress visibility, not as proof that blockers or review debt are cleared
163
+
133
164
  ## How `change-id` Works
134
165
 
135
166
  `change-id` is the directory name under `.da-vinci/changes/<change-id>/`.
@@ -10,11 +10,14 @@ Use it when you need the high-level delivery chain:
10
10
  - page-to-design mapping
11
11
  - implementation and verification
12
12
 
13
- Use [pencil-rendering-workflow.md](/Users/xubo/x-skills/da-vinci/docs/pencil-rendering-workflow.md) when you need the lower-level Pencil session, persistence, gate, and audit details.
14
- Use [dv-command-reference.md](/Users/xubo/x-skills/da-vinci/docs/dv-command-reference.md) when you need route-by-route `dv:` command behavior, next-step recommendations, and verify rollback handling.
15
- Use [constraint-files.md](/Users/xubo/x-skills/da-vinci/docs/constraint-files.md) when you need a single map for project constraint files, hard-gate fields, and advisory guidance sections.
16
- Use [execution-chain-migration.md](/Users/xubo/x-skills/da-vinci/docs/execution-chain-migration.md) for sidecar, enforcement, persisted-state fallback, and scaffold migration guidance.
17
- Use [skill-usage.md](/Users/xubo/x-skills/da-vinci/docs/skill-usage.md) for an operator-facing guide to starting, pausing, resuming, and using the TUI.
13
+ Use [pencil-rendering-workflow.md](./pencil-rendering-workflow.md) when you need the lower-level Pencil session, persistence, gate, and audit details.
14
+ Use [dv-command-reference.md](./dv-command-reference.md) when you need route-by-route `dv:` command behavior, next-step recommendations, and verify rollback handling.
15
+ Use [constraint-files.md](./constraint-files.md) when you need a single map for project constraint files, hard-gate fields, and advisory guidance sections.
16
+ Use [execution-chain-migration.md](./execution-chain-migration.md) for sidecar, enforcement, persisted-state fallback, and scaffold migration guidance.
17
+ Use [skill-usage.md](./skill-usage.md) for an operator-facing guide to starting, pausing, resuming, and using the TUI.
18
+ If you are bootstrapping as a repository maintainer, start with
19
+ [maintainer-bootstrap.md](./maintainer-bootstrap.md)
20
+ as the canonical maintainer entry.
18
21
 
19
22
  ## Core Contract
20
23
 
@@ -33,6 +36,9 @@ This means:
33
36
  Truth-versus-orchestration boundary:
34
37
 
35
38
  - route and completion truth comes from artifacts, checkpoints, execution signals, and `audit`
39
+ - workflow memory is artifact-backed local state, not chat-derived memory
40
+ - `.da-vinci/state/workflow.json` is a persisted route cache, not the canonical owner of task-group runtime state
41
+ - `.da-vinci/state/task-groups/<change>.json` is the canonical persisted task-group runtime-state owner when workflow snapshots are written
36
42
  - orchestration hints such as execution profiles and worktree preflight remain advisory guidance
37
43
  - orchestration hints must never override explicit `BLOCK` truth from artifacts, checkpoints, or completion audit
38
44
 
@@ -54,14 +60,23 @@ Use these command surfaces to inspect route readiness before selecting the next
54
60
 
55
61
  - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
56
62
  - summarizes current stage, blockers, handoff gates, and route recommendation from artifact truth plus selected audit-visible evidence
63
+ - emits canonical task-group runtime state with compatibility fields plus layered planned / implementer / review / effective views
57
64
  - `da-vinci next-step --project <path> [--change <id>] [--json]`
58
65
  - emits the first continuation action from the same derived workflow-state model
66
+ - uses the same task-group runtime-state model as `workflow-status` instead of a separate checklist-only interpretation
67
+ - JSON output includes `blockingGate` when clarify/analyze/task-checkpoint promotion is blocked
59
68
  - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
60
69
  - validates runtime `spec.md` schema quality before implementation planning or execution
70
+ - emits machine-readable gates under `gates.principleInheritance`, `gates.clarify`, and `gates.scenarioQuality`
71
+ - clarify bounded ambiguity with complete metadata stays visible under `gates.clarify.bounded` and notes, and is non-blocking by default
61
72
  - default behavior is advisory; `--strict` is explicit opt-in for blocking behavior
62
73
  - `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
63
74
  - validates page and state propagation across proposal, page-map, runtime specs, pencil-design, and tasks
75
+ - emits machine-readable coherence gate output under `gates.analyze`
64
76
  - emits a machine-readable page/state coverage matrix for later verify and status consumers
77
+ - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
78
+ - validates task-group planning discipline plus anchor traceability to upstream planning evidence
79
+ - emits machine-readable gate output under `gates.taskCheckpoint`
65
80
  - `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
66
81
  - explicitly generates deterministic planning sidecars used by diff and downstream tooling
67
82
  - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
@@ -77,6 +92,24 @@ Use these command surfaces to inspect route readiness before selecting the next
77
92
 
78
93
  These surfaces do not replace `da-vinci audit --mode integrity|completion`.
79
94
  `audit` remains the formal integrity and completion truth surface.
95
+ - in integrity mode, planning-signal notes keep bounded clarify context visible even when `lint-spec` top-level signal status is `PASS`
96
+
97
+ Persisted-state trust rules:
98
+
99
+ - persisted workflow snapshots remain usable when governing artifact content digests still match, even if the snapshot is old
100
+ - age alone is advisory and no longer invalidates persisted route truth
101
+ - live overlays such as execution signals, audits, discipline, and verification freshness are recomputed on every read
102
+
103
+ Planning-gate strictness control plane:
104
+
105
+ - command-level lint strictness uses existing `--strict`
106
+ - workflow promotion strictness uses `DA_VINCI_DISCIPLINE_STRICT_PROMOTION`
107
+ - planning gates do not introduce a separate strict-flag family
108
+
109
+ Spec-kit borrowing boundary:
110
+
111
+ - Da Vinci borrows clarify/analyze/gate-method ideas only.
112
+ - Da Vinci does not adopt spec-kit constitution/init/branch/toolchain workflow.
80
113
 
81
114
  ## Standard Artifact Spine
82
115
 
@@ -202,6 +235,8 @@ After mapping passes:
202
235
  - inspect `executionProfile` from `workflow-status` or `next-step --json` before broad implementation
203
236
  - if bounded parallelism is suggested, run `da-vinci worktree-preflight --project <path> [--change <id>]` and downgrade to serial when isolation is not ready
204
237
  - persist per-task implementer and review evidence via `task-execution` and ordered `task-review` records
238
+ - read task-group `nextAction` and `resumeCursor` as runtime-aware focus when live evidence is fresher than checklist state
239
+ - keep reading flat task-group `completion` as checklist-derived progress percentage rather than runtime health
205
240
  - verify requirement drift and design drift
206
241
 
207
242
  ### 8. Terminal Completion
@@ -11,7 +11,8 @@
11
11
  - 正常推进时这些命令怎么衔接
12
12
  - `verify` 出问题后应该退回哪一层
13
13
 
14
- 大流程请看 [workflow-overview.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/workflow-overview.md),Pencil 渲染和门禁请看 [pencil-rendering-workflow.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/pencil-rendering-workflow.md)。
14
+ 大流程请看 [workflow-overview.md](./workflow-overview.md),Pencil 渲染和门禁请看 [pencil-rendering-workflow.md](./pencil-rendering-workflow.md)。
15
+ 如果你是在维护这个仓库本身,请先看 [maintainer-bootstrap.md](./maintainer-bootstrap.md) 再进入更深命令面。
15
16
 
16
17
  ## 核心理解
17
18
 
@@ -43,24 +44,37 @@ Da Vinci 期望它们遵循工作流状态。
43
44
  - 打开面向工作流的终端 UI,按阶段组织命令,并在执行前先展示生成出的 CLI 预览
44
45
  - 也可以用独立 bin `da-vinci-tui`,或在没全局安装时用 `npx -p @xenonbyte/da-vinci-workflow da-vinci tui`
45
46
  - 当真正难记的是命令面而不是流程本身时,优先用它
47
+ - `da-vinci verify-install [--platform <value>] [--json]`
48
+ - 校验显式选中的维护者平台安装置信度(例如只校验 `codex`)
49
+ - 未选平台会以 `out_of_scope` / degraded coverage 展示,不会直接判定失败
50
+ - 未传 `--platform` 时会报告 unknown scope,不会根据缺失资产猜测维护者意图
51
+ - `da-vinci maintainer-readiness [--platform <value>] [--project <path>] [--json]`
52
+ - 仓库维护者的 canonical 诊断/就绪面(diagnosis),与 bootstrap/setup 分离
53
+ - 组合 packaged-asset 校验、verify-install 置信度和聚焦 contracts lane(`npm run quality:ci:contracts`)
54
+ - 输出可执行下一步,并把更深层 lane(`quality:ci:e2e`、`quality:ci`)作为可选升级路径
55
+ - 明确比 full CI 更窄;高风险改动再升级到更深校验
46
56
  - `da-vinci workflow-status --project <path> [--change <id>] [--json]`
47
57
  - 从工件和 checkpoint 真相推导当前 workflow 阶段
48
58
  - 报告 blocker、warning、handoff gate、discipline marker、execution profile 提示与 verification freshness
49
59
  - 它和 `audit` 职责不同:它负责选路,不是终态审计真相
50
60
  - `da-vinci next-step --project <path> [--change <id>] [--json]`
51
61
  - 基于同一套 workflow-state 推导,给出 route-first 的续跑建议
52
- - JSON 输出包含 `nextStep`、`executionProfile`、`worktreePreflight` 与 discipline/freshness 元数据
62
+ - JSON 输出包含 `nextStep`、`blockingGate`、`executionProfile`、`worktreePreflight` 与 discipline/freshness 元数据
53
63
  - 在自由扫描工件之前,优先把它作为第一路由信号
54
64
  - `da-vinci lint-spec --project <path> [--change <id>] [--strict] [--json]`
55
65
  - 校验 Da Vinci 运行时 `spec.md` 的核心章节(`Behavior`、`States`、`Inputs`、`Outputs`、`Acceptance`、`Edge Cases`)
66
+ - JSON 输出机器可读 planning gate:`gates.principleInheritance`、`gates.clarify`、`gates.scenarioQuality`
67
+ - 当 bounded 元数据完整时,bounded-only clarify 会保留在 `gates.clarify.bounded` 与 notes 中,默认不阻断
56
68
  - 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
57
69
  - 不会把 OpenSpec 规划用的 `ADDED Requirements` 结构当成运行时 spec 合法结构
58
70
  - `da-vinci scope-check --project <path> [--change <id>] [--strict] [--json]`
59
71
  - 检查 proposal、page-map、运行时 spec、pencil-design 状态和 tasks 之间的 scope 传播一致性
72
+ - JSON 输出机器可读 analyze gate:`gates.analyze`
60
73
  - 输出页面与状态两条线的机器可读覆盖矩阵
61
74
  - 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
62
75
  - `da-vinci lint-tasks --project <path> [--change <id>] [--strict] [--json]`
63
76
  - 校验顶层 task groups、编号顺序、discipline markers、执行模式提示、文件目标、verification 命令与 behavior 覆盖提示
77
+ - 校验 task-anchor 语法(`Planning anchors:` 与 `anchor:<ref>`)并输出机器可读 checkpoint gate:`gates.taskCheckpoint`
64
78
  - 默认 advisory(有发现给 `WARN` 且不阻断);显式 `--strict` 才升级为阻断
65
79
  - `da-vinci lint-bindings --project <path> [--change <id>] [--strict] [--json]`
66
80
  - 校验实现到 Pencil 的映射是否可解析、source 形态是否合理、实现落点是否可定位
@@ -68,9 +82,21 @@ Da Vinci 期望它们遵循工作流状态。
68
82
  - `da-vinci generate-sidecars --project <path> [--change <id>] [--json]`
69
83
  - 显式生成确定性的 planning sidecars:`spec.index.json`、`tasks.index.json`、`page-map.index.json`、`bindings.index.json`
70
84
  - sidecar 只允许通过这个命令写入;lint/status/verify 不应静默重写
71
- - `da-vinci verify-bindings|verify-implementation|verify-structure|verify-coverage --project <path> [--change <id>] [--strict] [--json]`
72
- - 校验代码落点、计划状态实现证据、以及绑定驱动的结构一致性
73
- - `verify-structure` 会明确报告是 markup-backed 还是 heuristic fallback,并给出置信度
85
+ - `da-vinci verify-bindings --project <path> [--change <id>] [--strict] [--json]`
86
+ - 校验 `pencil-bindings.md` 的实现落点能否被正确解析
87
+ - `da-vinci verify-implementation --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
88
+ - 以每个检查项的 `mode` + `confidence` 证据模型校验状态/任务组实现覆盖
89
+ - JS/TS 会走语法感知检查,不把“仅注释命中”或“仅字符串字面量命中”当作正常覆盖
90
+ - 使用 `--changed-files` 时会进入显式增量模式(partial 语义),并输出 selected/scanned/filtered 统计
91
+ - `da-vinci verify-structure --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
92
+ - 校验 bindings 驱动的结构一致性,并显式报告 `markup`/`heuristic` 置信度
93
+ - 使用 `--changed-files` 时,不相关条目会被显式报告,不会静默扩展成全量扫描
94
+ - `da-vinci verify-coverage --project <path> [--change <id>] [--changed-files <csv>] [--strict] [--json]`
95
+ - 聚合上游 verify surface,并在上游是增量验证时明确标记 partial freshness
96
+ - `da-vinci scaffold --project <path> [--change <id>] [--output <path>] [--json]`
97
+ - 生成 framework-aware 的 TODO 可审查骨架(`next`/`react`/`vue`/`svelte`/`html`)
98
+ - 若已存在明确实现落点,会优先保留该落点的扩展名与路由形状
99
+ - 框架未知或冲突时显式告警并回退 HTML;同时继续严格执行 traversal/output-root 安全约束
74
100
  - `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
101
  - 持久化结构化 implementer 执行结果包,作为 task 级执行证据
76
102
  - `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]`
@@ -0,0 +1,101 @@
1
+ # Maintainer Bootstrap 指南
2
+
3
+ 这份文档是“维护 Da Vinci 仓库本身”的 canonical 入口。
4
+
5
+ ## 先划边界
6
+
7
+ - 仓库维护者 bootstrap:准备修改这个仓库。
8
+ - 下游项目 bootstrap:`da-vinci bootstrap-project` 用于给其他项目初始化 `.da-vinci/` 工件。
9
+ - 安装状态:`da-vinci status` / `da-vinci verify-install` 只校验安装置信度,不等于仓库就绪度。
10
+ - operator 工作流执行:下游项目操作请看 operator 文档,不要把它当维护者 bootstrap 入口。
11
+
12
+ ## Clone 后前 10 分钟
13
+
14
+ 1. 安装依赖:`npm install`
15
+ 2. 校验打包资产:`npm run validate-assets`
16
+ 3. 显式校验安装范围(推荐):`da-vinci verify-install --platform codex`
17
+ 4. 运行维护者 canonical 就绪检查:`da-vinci maintainer-readiness --platform codex`
18
+
19
+ 如果你维护多个环境,请显式传入多个平台:
20
+
21
+ - `da-vinci verify-install --platform codex,claude`
22
+ - `da-vinci maintainer-readiness --platform codex,claude`
23
+
24
+ 这些命令应在你要维护的仓库根目录执行。需要时可用 `--project <path>` 显式指定目标仓库。
25
+
26
+ ## 入口面分层
27
+
28
+ - Canonical 入口:
29
+ - 本文档 + `da-vinci maintainer-readiness`
30
+ - Secondary/advanced 维护者面:
31
+ - `npm run quality:ci:contracts`
32
+ - `npm run quality:ci:e2e`
33
+ - `npm run quality:ci`
34
+ - 针对回归的 `scripts/test-*.js`
35
+ - 下游项目面(非仓库维护 bootstrap):
36
+ - `da-vinci bootstrap-project`
37
+ - 项目 `.da-vinci/` 工件工作流
38
+ - bootstrap 相邻的安装面:
39
+ - `da-vinci status`
40
+ - `da-vinci verify-install`
41
+
42
+ ## Bootstrap 与 Diagnosis
43
+
44
+ - Bootstrap/setup 回答的是:“我如何准备好在这里工作?”
45
+ - Diagnosis/readiness 回答的是:“当前仓库 + 本地环境是否足够健康以推进本次改动?”
46
+
47
+ Canonical diagnosis 面:
48
+
49
+ - `da-vinci maintainer-readiness`
50
+
51
+ 该命令刻意比 full CI 更窄,并提供可执行的下一步。默认包含:
52
+
53
+ - 打包资产校验
54
+ - selected-platform 的 verify-install 置信度
55
+ - 聚焦质量 lane:`npm run quality:ci:contracts`
56
+
57
+ ## Selected Platform 语义
58
+
59
+ - 显式 `--platform`:只有选中的平台是阻断项。
60
+ - 未选平台仍可见,但会标为 `out_of_scope` / degraded coverage。
61
+ - 未传 `--platform`:按 unknown scope 报告 degraded coverage,不会硬失败。
62
+
63
+ ## Use This / Do Not Use This
64
+
65
+ - Use this:
66
+ - `da-vinci verify-install --platform codex`,然后 `da-vinci maintainer-readiness --platform codex`
67
+ - Do not use this:
68
+ - 只跑 `da-vinci status` 就判断仓库就绪
69
+ - Use this:
70
+ - 用本指南做仓库维护者入门
71
+ - Do not use this:
72
+ - 把 `da-vinci bootstrap-project` 当成这个仓库的维护者 bootstrap
73
+ - Use this:
74
+ - 只有在下游项目操作时才看 operator 文档
75
+ - Do not use this:
76
+ - 把 operator 工作流文档当成维护者首入口
77
+
78
+ ## 常见排错
79
+
80
+ - 现象:`verify-install` 是 WARN 且 scope unknown。
81
+ - 处理:补 `--platform <value>` 显式声明 selected scope。
82
+ - 现象:`maintainer-readiness` 在 verify-install 上 BLOCK。
83
+ - 处理:先修 selected-platform 安装问题,再重跑 readiness。
84
+ - 现象:安装检查都通过,但对改动仍缺乏信心。
85
+ - 处理:升级跑更深的 lanes(`quality:ci:e2e` 或 `quality:ci`)和目标脚本。
86
+ - 现象:混淆仓库 bootstrap 与下游项目 bootstrap。
87
+ - 处理:仓库维护按本指南,下游仓库才使用 `bootstrap-project`。
88
+
89
+ ## 更深层验证 Lane
90
+
91
+ 高风险或范围较大的改动前建议执行:
92
+
93
+ - `npm run quality:ci:e2e`
94
+ - `npm run quality:ci`
95
+
96
+ ## Operator 工作流参考
97
+
98
+ operator 文档与维护者 bootstrap 保持分离:
99
+
100
+ - [skill-usage.md](./skill-usage.md)
101
+ - [workflow-overview.md](./workflow-overview.md)
@@ -12,7 +12,7 @@
12
12
  - screenshot review
13
13
  - runtime gate 和 filesystem audit
14
14
 
15
- 如果你想看 `design`、`tasks`、`build`、`verify` 这些 `dv:` 路由之间怎么衔接,以及 `verify` 出问题后退回哪一层,请看 [dv-command-reference.md](/Users/xubo/x-skills/da-vinci/docs/zh-CN/dv-command-reference.md)。
15
+ 如果你想看 `design`、`tasks`、`build`、`verify` 这些 `dv:` 路由之间怎么衔接,以及 `verify` 出问题后退回哪一层,请看 [dv-command-reference.md](./dv-command-reference.md)。
16
16
 
17
17
  ## 渲染真相模型
18
18
 
@@ -72,6 +72,7 @@
72
72
  - 如果页面或状态在规划工件中的传播关系不确定,进入 `build` 前先运行 `da-vinci scope-check --project <path> [--change <id>]`
73
73
  - 如果任务拆解质量不确定,进入 `build` 前先运行 `da-vinci lint-tasks --project <path> [--change <id>]`
74
74
  - 进入终态前先运行 `da-vinci verify-bindings --project <path> [--change <id>]` 与 `da-vinci verify-coverage --project <path> [--change <id>]`
75
+ - 若在 `verify-implementation`/`verify-structure`/`verify-coverage` 使用 `--changed-files`,要把结果视为显式增量 partial 证据,而不是全量 fresh 验证
75
76
  - 当规划切片有改动且需要恢复判断时,运行 `da-vinci diff-spec --project <path> [--change <id>]`
76
77
  - 先根据工件和 checkpoint 真相决定路由
77
78
  - Context Delta 只用于恢复和解释,不用于覆盖选路