@deksden-com/dd-flow-cli 0.3.0 → 0.4.0

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 (38) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +74 -5
  3. package/dist/build-info.json +5 -5
  4. package/dist/cli/help.js +116 -18
  5. package/dist/cli/run-cli.js +361 -29
  6. package/dist/schemas/compatibility.schema.json +81 -2
  7. package/dist/schemas/engine-manifest.schema.json +61 -0
  8. package/dist/schemas/flow-guidance.schema.json +17 -0
  9. package/dist/schemas/global-dashboard-data.schema.json +60 -2
  10. package/dist/schemas/mb-upgrade-migration-report.schema.json +93 -0
  11. package/dist/schemas/project-dashboard-data.schema.json +26 -2
  12. package/dist/schemas/project-summary.schema.json +73 -0
  13. package/dist/schemas/protocol-dashboard-data.schema.json +25 -2
  14. package/dist/schemas/status-report.schema.json +4 -2
  15. package/dist/services/branch-context.js +254 -0
  16. package/dist/services/cleanup.js +31 -0
  17. package/dist/services/cli-operation-classifier.js +104 -0
  18. package/dist/services/compatibility-preflight.js +127 -0
  19. package/dist/services/config.js +6 -0
  20. package/dist/services/dashboard-targets.js +95 -0
  21. package/dist/services/dashboard.js +376 -59
  22. package/dist/services/engines.js +532 -0
  23. package/dist/services/flow-guidance.js +8 -1
  24. package/dist/services/hooks.js +1 -1
  25. package/dist/services/lanes.js +333 -1
  26. package/dist/services/merge-queue.js +310 -15
  27. package/dist/services/merge-worker.js +44 -3
  28. package/dist/services/migrations.js +231 -0
  29. package/dist/services/project-summary.js +122 -0
  30. package/dist/services/projects.js +41 -6
  31. package/dist/services/protocol-lifecycle.js +144 -0
  32. package/dist/services/protocols.js +34 -7
  33. package/dist/services/sessions.js +21 -4
  34. package/dist/services/status.js +10 -0
  35. package/dist/services/version-status.js +39 -15
  36. package/dist/storage/database.js +25 -0
  37. package/dist/storage/paths.js +12 -0
  38. package/package.json +3 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # @deksden-com/dd-flow-cli
2
+
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add branch/workspace protocol context for agents: `protocol branch-status`, `branch_context` in protocol and merge JSON outputs, and branch bundle status with eligible, not-ready and claimed protocol lists.
8
+
9
+ Add `merge bundle status|claim|complete|fail` commands so a merge worker can integrate one feature branch containing multiple ready protocols under the existing merge lane lock.
10
+
11
+ ### Patch Changes
12
+
13
+ - cfdcf1d: Fix compatibility status reporting so selected compatible engines advertise `normal_write` in `allowed_modes`; blocked operations are now reported only when a write is actually blocked by missing or incompatible engine resolution.
14
+
15
+ ## 0.3.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 16f68a3: Add router-native engine snapshot commands and routed project-command dispatch.
20
+
21
+ Also include the runtime/dashboard compatibility wave needed by the current Memory Bank canon:
22
+ - target-based dashboard `open`/`refresh` commands and related-command help;
23
+ - persisted FIFO lane waiters and merge wait-acquire specialization;
24
+ - `migration plan/report/verify` evidence helpers for controlled `mb-upgrade` runtime migrations;
25
+ - `dd-flow/project-summary@1` publication and global dashboard aggregation from project summaries.
26
+ - active npm release runbook notes for Changesets-generated changelogs, strict Memory Bank canon build metadata, token-safe publish, local global link and post-publish compatibility verification.
27
+
28
+ ## 0.3.0
29
+
30
+ ### Minor Changes
31
+
32
+ - Add CLI version preflight support with `dd-flow version`, `dd-flow --version`, `dd-flow version --json`, Memory Bank compatibility verdicts in `dd-flow status`, and an explicit cached npm registry check through `dd-flow status --check-registry`.
33
+ - 565c601: Add static HTML dashboard rendering for global, project, and protocol dashboard pages.
34
+
35
+ The dashboard command family now supports `--format html`, a `dashboard data` command, adjacent JSON data files, protocol pages, bundled dashboard schemas, and compatibility with existing markdown dashboards.
36
+
37
+ - Add `flow_guidance` to status-like protocol/run/project/merge outputs so agents can see current stage, allowed next stages, recommended prompt/action, guard status and missing predecessor evidence without moving semantic planning into the CLI.
38
+ - Store new `RUN-*` artifacts in DD Flow home under `~/.dd-flow/projects/<PRJ-ID>/runs/<RUN-ID>/`, while keeping legacy project `.tasks/dd-flow-runs/<RUN-ID>/` readable as compatibility input.
39
+ - Add protocol-set continuation support: protocol dependency blockers, `protocol ready`, safe `protocol-implement` guidance, blocked-protocol start guards and compact set status data for dashboards.
40
+ - Add `mb-sdlc-review` / `review` flow-kind support, bundled `mb-sdlc-review-report` schema validation, semantic review-report checks and dashboard counters for review runs.
41
+ - Extend dashboard data/rendering for protocol sets, review runs and home-run stage artifacts.
42
+
43
+ ### Patch Changes
44
+
45
+ - Keep merge queue, protocol runtime and run status in sync when a merge job completes, so agents can verify `closed` protocol state, `merged` queue state and `done/merged` run state without stale `claimed` diagnostics.
46
+
47
+ ## 0.2.0
48
+
49
+ ### Minor Changes
50
+
51
+ - Expose canonical Memory Bank version visibility in `dd-flow status`, including CLI build metadata, resolved canon metadata, project Memory Bank markers, project flow pack manifest state, drift diagnostics, and the `dd-flow/status-report@1` schema.
52
+
53
+ ### Patch Changes
54
+
55
+ - 322cae9: Add canonical Memory Bank discovery commands and runtime status output.
package/README.md CHANGED
@@ -97,6 +97,28 @@ dd-flow codex home --help
97
97
  dd-flow worktree --help
98
98
  ```
99
99
 
100
+ ## Engine Router
101
+
102
+ `dd-flow` is the stable router command. The router keeps immutable engine snapshots in `DD_FLOW_HOME/engines` and selects the compatible engine for project-scoped commands.
103
+
104
+ Router-native engine commands do not mutate project runtime:
105
+
106
+ ```bash
107
+ dd-flow engine install --json
108
+ dd-flow engine list --json
109
+ dd-flow engine info --json
110
+ dd-flow engine resolve --project-root "$PWD" --json
111
+ dd-flow engine doctor --project-root "$PWD" --json
112
+ ```
113
+
114
+ Old installable engines are installed from the matching published package version without replacing the global router:
115
+
116
+ ```bash
117
+ npx @deksden-com/dd-flow-cli@<version> engine install
118
+ ```
119
+
120
+ Project commands keep using `dd-flow ...`; agents should not call snapshot entrypoints directly.
121
+
100
122
  ## Lanes And Locks
101
123
 
102
124
  A lane is a named shared operational workspace inside a project. A lane lock is a time-bound ownership lease on that workspace. The CLI enforces one active non-expired lock per project/lane; prompts decide whether a task should use a feature worktree, `direct-main`, or `merge`.
@@ -121,10 +143,20 @@ Inspect lane state:
121
143
  ```bash
122
144
  dd-flow lane status --project-root "$PROJECT_ROOT" --json
123
145
  dd-flow lane lock status --project-root "$PROJECT_ROOT" --lane merge --json
146
+ dd-flow lane waiters --project-root "$PROJECT_ROOT" --lane merge --json
124
147
  ```
125
148
 
126
149
  Branch checks are factual diagnostics. Lock mutation and merge queue claiming validate the registered workspace path mechanically. A mismatch can help a prompt or operator notice the wrong checkout, but the CLI does not decide whether the route is semantically allowed.
127
150
 
151
+ Persisted lane waiters let agents wait for exclusive lane ownership without token-level polling:
152
+
153
+ ```bash
154
+ dd-flow lane lock wait-acquire --project-root "$PROJECT_ROOT" --lane merge --worker-id "$WORKER_ID" --path "$WORKSPACE" --timeout 300 --poll-interval 10 --ttl 300 --reason "merge worker" --json
155
+ dd-flow lane waiter cancel --project-root "$PROJECT_ROOT" --lane merge --worker-id "$WORKER_ID" --reason "session stopped" --json
156
+ ```
157
+
158
+ `wait-acquire` creates one queued waiter per `project/lane/worker-id`, preserves FIFO acquisition order, treats same-worker retries idempotently, returns `timed_out` for the command's own timeout, and leaves stale queued waiters for `cleanup scan/apply`.
159
+
128
160
  ## Direct Main Recipe
129
161
 
130
162
  Use `direct-main` only after the prompt or operator has chosen direct integration work for a small, low-risk task.
@@ -164,7 +196,9 @@ For supervisor-style waiting outside model tokens:
164
196
  dd-flow merge-queue wait-next --project-root "$PROJECT_ROOT" --worker-id "$WORKER_ID" --path "$MERGE_WORKSPACE" --timeout 1200 --poll-interval 10 --acquire-lock true --json
165
197
  ```
166
198
 
167
- With `--acquire-lock true`, `wait-next` heartbeats the merge lane lock while it waits and releases a lock it acquired itself when the wait times out. Live merge workers should prefer long waits, for example 1200 seconds / 20 minutes, so the agent sleeps inside the CLI process instead of spending model tokens on frequent polling.
199
+ With `--acquire-lock true`, `wait-next` first uses the generic FIFO lane waiter path for `lane=merge`, then heartbeats the merge lane lock while it waits and releases a lock it acquired itself when the wait times out. Live merge workers should prefer long waits, for example 1200 seconds / 20 minutes, so the agent sleeps inside the CLI process instead of spending model tokens on frequent polling.
200
+
201
+ Merge queue JSON uses `queue_item`, `protocol`, and `claim` as the primary queued/claimed protocol contract. The legacy `job` field remains as a compatibility alias during the migration window.
168
202
 
169
203
  Complete or fail the claimed job:
170
204
 
@@ -206,6 +240,32 @@ dd-flow protocol cancel PRT-... --reason "replaced by fresh run" --close-session
206
240
 
207
241
  For a stale disposable feature checkout, use `--worktree remove`. The command removes the git worktree recorded either in `worktree_records` or in stable runtime `state.workspace`; with `--force`, it also force-deletes the local feature branch when present. It refuses dirty worktrees without `--force` and refuses to remove the stable project root or the current process working directory.
208
242
 
243
+ ## mb-upgrade Runtime Migrations
244
+
245
+ Normal `dd-flow` commands do not migrate project runtime or home data just because a newer router/engine can read an older project. Runtime/home data migrations belong to the explicit canonical `mb-upgrade` contour and need backup evidence, an adjacent migration chain, active-state handling and post-upgrade verification.
246
+
247
+ Use migration evidence helpers from `mb-upgrade`:
248
+
249
+ ```bash
250
+ dd-flow migration plan --project-root "$PROJECT_ROOT" --source-version "$OLD_MB" --target-version "$NEW_MB" --run "$RUN_ID" --backup-path "$BACKUP" --json
251
+ dd-flow migration report --project-root "$PROJECT_ROOT" --source-version "$OLD_MB" --target-version "$NEW_MB" --run "$RUN_ID" --backup-path "$BACKUP" --json
252
+ dd-flow migration verify --file "$RUN_HOME/03-upgrade/migration-report.json" --json
253
+ ```
254
+
255
+ The report contract is `dd-flow/mb-upgrade-migration-report@1`. A blocked report is valid evidence that upgrade cannot safely mutate runtime yet; it is not permission to bypass active protocols, active runs, merge queue items or lane locks.
256
+
257
+ ## Project Summaries
258
+
259
+ Global dashboard data should consume compact project summaries instead of scanning deep project runtime directly. Publish the current project's read model with:
260
+
261
+ ```bash
262
+ dd-flow project summary --project-root "$PROJECT_ROOT" --json
263
+ ```
264
+
265
+ The summary is written to `~/.dd-flow/projects/<project-id>/summary/project-summary.json` and uses `dd-flow/project-summary@1`. `dashboard refresh --project <project>` also publishes the summary before rendering dashboards. Use `--write false` to inspect the payload without writing it.
266
+
267
+ Global dashboard data reads published project summaries and builds one prepared JSON model for the renderer. Compatible summaries become project cards; missing, unreadable or unsupported summaries are listed in `unsupported_projects` with a reason, summary path and install/refresh hint when available. The global dashboard also exposes `supported_summary_versions` and `summary_version_groups` so agents can see which local projects are represented by each summary contract version.
268
+
209
269
  ## Cleanup
210
270
 
211
271
  Use cleanup when local runtime state is stale after a crash, abandoned rerun, or removed feature worktree. `cleanup scan` is read-only. `cleanup apply` requires an explicit plan file and reason, reports requested/applied/changed/skipped action results, and dirty/destructive worktree actions require `--force --reason`. Worktree record cleanup marks a checkout `removed` only when the path is already absent; if the checkout still exists, the record is closed as `kept` rather than silently deleting files.
@@ -224,6 +284,8 @@ Dashboard markdown is rendered state, not source of truth. Successful state-chan
224
284
 
225
285
  The dashboard is intentionally compact: it shows the last update time, active protocols/sessions, merge queue summary, active locks, recent outcomes, and missing project roots without dumping full hook payloads into the main view.
226
286
 
287
+ Dashboard JSON separates protocol lifecycle from resource coordination. New consumers should read `lifecycle`, `lifecycle_summary`, `resource_summary`, `queued_protocols`, `queue_item`, and `claim` when present. Legacy fields such as `current_stage`, `raw_stage`, `raw_status`, `merge_queue`, and `job` remain available as compatibility aliases or diagnostics during the migration window.
288
+
227
289
  Defaults:
228
290
 
229
291
  ```text
@@ -236,12 +298,19 @@ protocol HTML: ~/.dd-flow/projects/<PRJ-ID>/dashboard/protocols/<PRT-ID>.htm
236
298
  Useful commands:
237
299
 
238
300
  ```bash
239
- dd-flow dashboard render --project-root "$PROJECT_ROOT" --json
240
- dd-flow dashboard render-global --json
241
- dd-flow dashboard refresh --project-root "$PROJECT_ROOT" --open false --json
242
- dd-flow dashboard open --project-root "$PROJECT_ROOT" --viewer cmux --json
301
+ dd-flow dashboard open --json
302
+ dd-flow dashboard refresh --json
303
+ dd-flow dashboard refresh --all --json
304
+ dd-flow dashboard refresh --project PRJ-001 --open false --json
305
+ dd-flow dashboard open --project PRJ-001 --viewer cmux --json
306
+ dd-flow dashboard data --project PRJ-001 --json
243
307
  ```
244
308
 
309
+ Compatibility forms remain available for older prompts and scripts: `refresh-global`,
310
+ `render-global`, `--project-root`, and `data --global`. Prefer the target-based
311
+ commands above for new automation. `--project` accepts a full project id, short
312
+ id, slug, or registered project root path.
313
+
245
314
  Config keys:
246
315
 
247
316
  ```bash
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "cli_package": "@deksden-com/dd-flow-cli",
3
- "cli_version": "0.3.0",
4
- "cli_commit": "059594c2096e080548d470e789f594e20a1a8ebd",
5
- "built_at": "2026-06-30T20:32:13.018Z",
3
+ "cli_version": "0.4.0",
4
+ "cli_commit": "3ab5ed2a5efcd2d1aa8a13a530b94995abe2bd3b",
5
+ "built_at": "2026-07-05T17:44:47.134Z",
6
6
  "built_with_canon": {
7
- "version": "2.8.0",
8
- "commit": "f549c33bd73d8d18b5cb07d9737b02fe638e61b8",
7
+ "version": "2.10.0",
8
+ "commit": "228a069278ead592d2bee435a33e0da90536227b",
9
9
  "flow_contract": "dd-flow-canonical-2026-06",
10
10
  "repo_root": "/Users/deksden/Documents/_Projects/dd-memorybank",
11
11
  "memorybank_root": "/Users/deksden/Documents/_Projects/dd-memorybank/.memory-bank",
package/dist/cli/help.js CHANGED
@@ -11,21 +11,24 @@ Usage:
11
11
  Core commands:
12
12
  version Print the installed dd-flow CLI package version.
13
13
  status Inspect dd-flow runtime, project and canon roots.
14
+ engine install/list/info Manage locally installed dd-flow engine snapshots.
15
+ engine resolve/doctor Inspect router engine selection and health.
14
16
  canon register/status/resolve Register and resolve the canonical Memory Bank.
15
- project register/status Register a project and inspect runtime state.
17
+ project register/status/summary Register a project, inspect state, and publish project summaries.
16
18
  project resolve/archive Resolve typed ids and archive stale project roots.
17
19
  project migrate-ids Migrate old project ids.
18
20
  protocol register/status/transition Register, inspect, transition and repair protocol state.
21
+ migration plan/report/verify Prepare and verify mb-upgrade runtime migration evidence.
19
22
  cleanup scan/apply Detect and repair stale local runtime state.
20
23
  run start/status/list Track concrete flow executions and stage artifacts.
21
24
  id next Preview next typed ids for protocol or run allocation.
22
25
  plan set/status/item Attach and update protocol plans.
23
26
  lane workspace/lock/status Manage shared workspace lanes and leases.
24
- merge status/one-shot Inspect or claim one merge job from the current session.
27
+ merge status/one-shot/bundle Inspect, claim, or complete merge work from the current session.
25
28
  merge-worker status/start/stop Manage long-lived project merge workers.
26
29
  merge-queue status/next Claim, wait for, complete, or fail merge jobs.
27
30
  session register/status/stop Register flow sessions and stop workers.
28
- dashboard data/render/open/refresh Render markdown or HTML project/global dashboards.
31
+ dashboard data/render/open/refresh Render, refresh, open, and inspect project/global dashboards.
29
32
  schema validate Validate canonical dd-flow JSON data contracts.
30
33
  memory permissions preflight Check Memory Bank write/read permissions.
31
34
  integration cmux status Inspect optional cmux integration.
@@ -35,6 +38,8 @@ Core commands:
35
38
  Examples:
36
39
  dd-flow project register --root "$PWD"
37
40
  dd-flow version
41
+ dd-flow engine install --json
42
+ dd-flow engine resolve --project-root "$PWD" --json
38
43
  dd-flow status --project-root "$PWD" --json
39
44
  dd-flow canon register --root "$DD_MEMORYBANK" --json
40
45
  dd-flow canon resolve --json
@@ -68,6 +73,29 @@ version reports the installed dd-flow CLI package version from package metadata.
68
73
  Examples:
69
74
  dd-flow version
70
75
  dd-flow version --json`
76
+ ],
77
+ [
78
+ "engine",
79
+ `dd-flow engine - manage router-installed engine snapshots
80
+
81
+ Usage:
82
+ dd-flow engine install [--force] --json
83
+ dd-flow engine list --json
84
+ dd-flow engine info [--package <name>] [--version <version>] --json
85
+ dd-flow engine resolve [--project-root <root>] --json
86
+ dd-flow engine doctor [--project-root <root>] --json
87
+
88
+ The globally invoked dd-flow command is the stable router surface. Engine snapshots live under DD_FLOW_HOME/engines and are selected by project Memory Bank compatibility data. Running an old package through npx can install that package's own engine without replacing the global router:
89
+
90
+ npx @deksden-com/dd-flow-cli@<version> engine install
91
+
92
+ Router-native engine commands never mutate project runtime data. Normal project commands are routed to a compatible engine or fail closed with a missing-engine diagnostic.
93
+
94
+ Examples:
95
+ dd-flow engine install --json
96
+ dd-flow engine list --json
97
+ dd-flow engine resolve --project-root "$PWD" --json
98
+ dd-flow engine doctor --project-root "$PWD" --json`
71
99
  ],
72
100
  [
73
101
  "status",
@@ -145,6 +173,8 @@ Examples:
145
173
  Usage:
146
174
  dd-flow protocol register <handshake-id> --project-root <root> [--workspace-path <checkout>] --json
147
175
  dd-flow protocol status <protocol-id> --json
176
+ dd-flow protocol branch-status <protocol-id> --json
177
+ dd-flow protocol branch-status --project-root <root> --path <workspace> --json
148
178
  dd-flow protocol ready --project-root <root> --json
149
179
  dd-flow protocol blockers <protocol-id> --project-root <root> --json
150
180
  dd-flow protocol implement <protocol-id> --project-root <root> [--force --reason <text>] --json
@@ -153,7 +183,7 @@ Usage:
153
183
  dd-flow protocol ready-for-merge <protocol-id> --json
154
184
  dd-flow protocol cancel <protocol-id> --reason <text> [--close-sessions true|false] [--cancel-queue true|false] [--release-locks true|false] [--worktree keep|remove] [--force] --json
155
185
 
156
- ready, blockers and implement read protocol markdown frontmatter plus runtime state. implement is a preflight/guidance command: it never performs implementation, refuses unresolved blocked_by_protocols unless --force --reason is supplied, refuses terminal protocols and reports the expected next prompt/stage. transition validates the snapshotted flow contract stored in protocol runtime state, writes an audit event and updates lifecycle fields from the payload. --json-file is accepted as a compatibility alias for --payload-file. sync-from-run repairs legacy protocol/run mismatch from concrete RUN evidence instead of requiring manual runtime JSON edits.
186
+ ready, blockers and implement read protocol markdown frontmatter plus runtime state. branch-status is read-only and reports the current protocol/workspace branch context: sibling protocols in the same branch/worktree, queue status, active sessions and merge bundle eligibility. implement is a preflight/guidance command: it never performs implementation, refuses unresolved blocked_by_protocols unless --force --reason is supplied, refuses terminal protocols and reports the expected next prompt/stage. transition validates the snapshotted flow contract stored in protocol runtime state, writes an audit event and updates lifecycle fields from the payload. --json-file is accepted as a compatibility alias for --payload-file. sync-from-run repairs legacy protocol/run mismatch from concrete RUN evidence instead of requiring manual runtime JSON edits.
157
187
 
158
188
  The project_root is the stable project identity used for queues, sessions, lanes, and dashboards. Runtime state is stored under DD_FLOW_HOME/projects/<PRJ-ID-slug>/runtime so feature worktree removal does not break status, cancel, or merge finalization. The optional workspace_path records the concrete checkout where the agent works. With --worktree remove, cancel removes the disposable git worktree recorded in runtime state or worktree records; with --force it also force-deletes the local feature branch when present.`
159
189
  ],
@@ -174,12 +204,29 @@ Prefer dd-flow protocol transition in new prompts and scripts. This top-level al
174
204
  Usage:
175
205
  dd-flow project register --root <root> --json
176
206
  dd-flow project status --root <root> --json
207
+ dd-flow project summary --project-root <root> [--write true|false] --json
177
208
  dd-flow project resolve <PRJ-ID|PRJ-NNN> --json
178
209
  dd-flow project archive <PRJ-ID|PRJ-NNN> --reason <text> --json
179
210
  dd-flow project archive --root <previous-root-path> --reason <text> --json
180
211
  dd-flow project migrate-ids --root <root> [--apply] --json
181
212
 
182
- New registrations use full typed ids such as PRJ-001-dd-flow-playground and short aliases such as PRJ-001. project resolve accepts full id or unique short alias. project archive removes stale or deleted project roots from active dashboards without deleting history. Re-registering an existing root reactivates it. migrate-ids is the explicit transition path for old hash-based local project ids; without --apply it returns a dry-run plan.`
213
+ New registrations use full typed ids such as PRJ-001-dd-flow-playground and short aliases such as PRJ-001. project resolve accepts full id or unique short alias. project summary writes dd-flow/project-summary@1 to the project's home summary directory by default; use --write false to inspect the payload without writing. project archive removes stale or deleted project roots from active dashboards without deleting history. Re-registering an existing root reactivates it. migrate-ids is the explicit transition path for old hash-based local project ids; without --apply it returns a dry-run plan.`
214
+ ],
215
+ [
216
+ "migration",
217
+ `dd-flow migration - plan and verify mb-upgrade runtime/home data migrations
218
+
219
+ Usage:
220
+ dd-flow migration plan --project-root <root> [--source-version <version>] [--target-version <version>] [--run <RUN-ID>] [--backup-path <path>] [--backup-created-at <iso>] [--allow-active true|false] --json
221
+ dd-flow migration report --project-root <root> [--source-version <version>] [--target-version <version>] [--run <RUN-ID>] [--backup-path <path>] [--backup-created-at <iso>] [--allow-active true|false] --json
222
+ dd-flow migration verify --file <mb-upgrade-migration-report.json> --json
223
+
224
+ Migration commands are evidence and guardrail helpers for canonical mb-upgrade. They do not silently migrate runtime/home data during ordinary CLI use. Applying migrations remains an explicit mb-upgrade contour with backup, adjacent migration chain, active-state handling, derived artifact regeneration and post-upgrade verification.
225
+
226
+ Related commands:
227
+ dd-flow status --project-root <root> --json
228
+ dd-flow memory permissions preflight --root <root> --memory-bank .memory-bank --flow mb-upgrade --mode write --json
229
+ dd-flow dashboard refresh --project <project> --json`
183
230
  ],
184
231
  [
185
232
  "lane",
@@ -187,13 +234,16 @@ New registrations use full typed ids such as PRJ-001-dd-flow-playground and shor
187
234
 
188
235
  Usage:
189
236
  dd-flow lane status --project-root <root> --json
237
+ dd-flow lane waiters --project-root <root> [--lane <name>] --json
190
238
  dd-flow lane workspace <action> [options] --json
191
239
  dd-flow lane lock <action> [options] --json
240
+ dd-flow lane waiter <action> [options] --json
192
241
 
193
242
  Use lanes when multiple agents might edit or merge through the same workspace. The CLI enforces mechanical ownership only; prompts decide whether a route should use merge, direct-main, or a feature worktree.
194
243
 
195
244
  Examples:
196
245
  dd-flow lane status --project-root "$PWD" --json
246
+ dd-flow lane waiters --project-root "$PWD" --lane merge --json
197
247
  dd-flow lane workspace set --project-root "$PWD" --lane direct-main --path "$PWD" --branch main --json
198
248
  dd-flow lane lock status --project-root "$PWD" --lane direct-main --json`
199
249
  ],
@@ -221,23 +271,44 @@ Usage:
221
271
  dd-flow lane lock release --project-root <root> --lane <name> --worker-id <id> [--path <workspace>] [--lease-token <token>] --reason <text> --json
222
272
  dd-flow lane lock status --project-root <root> --lane <name> --json
223
273
  dd-flow lane lock wait --project-root <root> --lane <name> --worker-id <id> [--path <workspace>] --timeout <seconds> --poll-interval <seconds> --json
274
+ dd-flow lane lock wait-acquire --project-root <root> --lane <name> --worker-id <id> [--path <workspace>] --timeout <seconds> --poll-interval <seconds> [--ttl 300] --reason <text> --json
224
275
 
225
- Lock mutation commands validate that --path, or the current working directory when --path is omitted, matches the registered lane workspace. Only the owner can heartbeat or release an active lease. Expired leases can be taken over mechanically and are recorded in audit.
276
+ Lock mutation commands validate that --path, or the current working directory when --path is omitted, matches the registered lane workspace. Only the owner can heartbeat or release an active lease. wait-acquire creates a persisted FIFO waiter before acquiring the lock. Expired leases and stale waiters are recorded in audit.
226
277
 
227
278
  Examples:
228
279
  dd-flow lane lock acquire --project-root "$PWD" --lane merge --worker-id worker-1 --path "$PWD" --ttl 300 --reason "merge worker" --json
280
+ dd-flow lane lock wait-acquire --project-root "$PWD" --lane merge --worker-id worker-1 --path "$PWD" --timeout 300 --poll-interval 10 --reason "merge worker" --json
229
281
  dd-flow lane lock heartbeat --project-root "$PWD" --lane merge --worker-id worker-1 --path "$PWD" --lease-token "$TOKEN" --json
230
282
  dd-flow lane lock release --project-root "$PWD" --lane merge --worker-id worker-1 --path "$PWD" --lease-token "$TOKEN" --reason done --json`
283
+ ],
284
+ [
285
+ "lane waiter",
286
+ `dd-flow lane waiter - inspect and cancel persisted lane waiters
287
+
288
+ Usage:
289
+ dd-flow lane waiters --project-root <root> [--lane <name>] --json
290
+ dd-flow lane waiter cancel --project-root <root> --lane <name> --worker-id <id> --reason <text> --json
291
+
292
+ Waiters are runtime coordination records, not protocols or domain jobs. Use waiters to coordinate fair access to exclusive lanes before a worker owns the lane lock.
293
+
294
+ Related lane commands:
295
+ dd-flow lane lock wait-acquire --project-root "$PWD" --lane merge --worker-id worker-1 --path "$PWD" --timeout 300 --poll-interval 10 --reason "merge worker" --json
296
+ dd-flow lane lock status --project-root "$PWD" --lane merge --json
297
+ dd-flow lane waiter cancel --project-root "$PWD" --lane merge --worker-id worker-1 --reason "session stopped" --json`
231
298
  ],
232
299
  [
233
300
  "merge",
234
301
  `dd-flow merge - current-session merge entrypoint helpers
235
302
 
236
303
  Usage:
237
- dd-flow merge status --project-root <root> --json
304
+ dd-flow merge status --project-root <root> [--path <workspace>] --json
238
305
  dd-flow merge one-shot --project-root <root> --worker-id <id> [--path <workspace>] --json
306
+ dd-flow merge bundle status --project-root <root> --path <workspace> --json
307
+ dd-flow merge bundle claim --project-root <root> --worker-id <id> --path <workspace> --json
308
+ dd-flow merge bundle complete --project-root <root> --worker-id <id> --path <workspace> --summary <text> --json
309
+ dd-flow merge bundle fail --project-root <root> --worker-id <id> --path <workspace> --reason <text> --requeue true|false --json
239
310
 
240
- merge status reports active merge worker, claimed jobs, active merge lane lock and queue state. merge one-shot is status-only when a long-lived worker, claimed job or active lock exists; otherwise it acquires the merge lane, claims at most one ready job, and returns that job for the shared merge job prompt. If no job is ready, it releases the lock and returns job: null.`
311
+ merge status reports active merge worker, claimed protocols, active merge lane lock, queue state and branch_context when --path is provided. merge one-shot keeps legacy single-protocol behavior and also returns branch_context. merge bundle commands operate on all ready protocols in the current branch/worktree: status is read-only, claim requires the merge lane lock owner, complete closes all claimed protocols after branch integration, and fail requeues or fails the claimed bundle.`
241
312
  ],
242
313
  [
243
314
  "merge-worker",
@@ -263,7 +334,11 @@ Usage:
263
334
  dd-flow merge-queue fail <protocol-id> --worker-id <id> [--path <workspace>] --reason <text> --requeue true|false --json
264
335
  dd-flow merge-queue cancel <protocol-id> --reason <text> [--worker-id <id>] [--path <workspace>] [--force] --json
265
336
 
266
- The worker must own the merge lane from the registered merge workspace before claiming, completing, or failing jobs. note updates the final completion summary after post-complete cleanup and does not require a lane lock. --path defaults to the current working directory. Use --worker-id as the owner identity.
337
+ The worker must own the merge lane from the registered merge workspace before claiming, completing, or failing queued protocols. Outputs use queue_item/protocol/claim as the primary contract and retain job as a compatibility alias. note updates the final completion summary after post-complete cleanup and does not require a lane lock. --path defaults to the current working directory. Use --worker-id as the owner identity.
338
+
339
+ For branch-level integration prefer:
340
+ dd-flow merge bundle status --project-root "$PWD" --path "$PWD" --json
341
+ dd-flow merge bundle claim --project-root "$PWD" --worker-id merge-worker --path "$PWD" --json
267
342
 
268
343
  Examples:
269
344
  dd-flow merge-queue wait-next --project-root "$PWD" --worker-id merge-worker --path "$PWD" --timeout 1200 --poll-interval 10 --acquire-lock true --json
@@ -282,12 +357,12 @@ cleanup scan is read-only and returns deterministic findings plus plan.actions.
282
357
  ],
283
358
  [
284
359
  "merge-queue wait-next",
285
- `dd-flow merge-queue wait-next - wait for the next ready merge job
360
+ `dd-flow merge-queue wait-next - wait for the next ready merge protocol
286
361
 
287
362
  Usage:
288
363
  dd-flow merge-queue wait-next --project-root <root> --worker-id <id> [--path <workspace>] --timeout <seconds> --poll-interval <seconds> [--acquire-lock true] --json
289
364
 
290
- Use this from a shell or supervisor to wait outside model tokens. Live merge workers should prefer long waits, for example --timeout 1200 --poll-interval 10, so the agent sleeps inside the CLI process instead of spending model tokens on frequent polling. If --acquire-lock true is used, the merge lock is heartbeated while waiting and a lock acquired by this command is released on timeout. If a job is ready, it is claimed atomically. If no job appears before the timeout, the command returns a structured timeout result.
365
+ Use this from a shell or supervisor to wait outside model tokens. Live merge workers should prefer long waits, for example --timeout 1200 --poll-interval 10, so the agent sleeps inside the CLI process instead of spending model tokens on frequent polling. If --acquire-lock true is used, wait-next first enters the generic FIFO lane waiter path (lane lock wait-acquire --lane merge), then heartbeats the merge lock while waiting for a ready protocol. A lock acquired by this command is released on timeout. If a protocol is ready, it is claimed atomically. If no protocol appears before the timeout, the command returns outcome: wait_timeout with queue_item: null and legacy job: null.
291
366
 
292
367
  Examples:
293
368
  dd-flow merge-queue wait-next --project-root "$PWD" --worker-id supervisor --path "$PWD" --timeout 1200 --poll-interval 10 --acquire-lock true --json`
@@ -332,18 +407,41 @@ Usage:
332
407
  ],
333
408
  [
334
409
  "dashboard",
335
- `dd-flow dashboard - render or open markdown and HTML dashboards
410
+ `dd-flow dashboard - render, refresh, open, and inspect markdown/HTML dashboards
336
411
 
337
412
  Usage:
338
- dd-flow dashboard data --project-root <root> [--protocol <PRT-ID>] --json
339
- dd-flow dashboard data --global --json
340
- dd-flow dashboard render --project-root <root> [--format markdown|html] [--protocol <PRT-ID>] [--output <path>] --json
413
+ dd-flow dashboard open [--viewer cmux] [--format html|markdown] --json
414
+ dd-flow dashboard refresh [--format html|markdown] --json
415
+ dd-flow dashboard refresh --all [--format html|markdown] --json
416
+ dd-flow dashboard refresh --project <project> [--format html|markdown] [--protocol <PRT-ID>] [--open auto|true|false] --json
417
+ dd-flow dashboard open --project <project> [--protocol <PRT-ID>] [--viewer cmux] [--format html] --json
418
+ dd-flow dashboard data [--project <project>] [--protocol <PRT-ID>] --json
419
+ dd-flow dashboard render [--project <project>] [--format html|markdown] [--protocol <PRT-ID>] [--output <path>] --json
420
+
421
+ Compatibility aliases and explicit low-level forms:
422
+ dd-flow dashboard refresh-global [--format markdown|html] [--output <path>] --json
423
+ Preferred: dd-flow dashboard refresh
341
424
  dd-flow dashboard render-global [--format markdown|html] [--output <path>] --json
342
- dd-flow dashboard open --project-root <root> [--format markdown|html] [--viewer cmux] --json
425
+ Preferred: dd-flow dashboard render
343
426
  dd-flow dashboard refresh --project-root <root> [--format markdown|html] [--protocol <PRT-ID>] [--open auto|true|false] --json
344
- dd-flow dashboard refresh-global [--format markdown|html] [--output <path>] --json
427
+ Preferred: dd-flow dashboard refresh --project <project>
428
+ dd-flow dashboard open --project-root <root> [--format markdown|html] [--viewer cmux] --json
429
+ Preferred: dd-flow dashboard open --project <project>
430
+ dd-flow dashboard render --project-root <root> [--format markdown|html] [--protocol <PRT-ID>] [--output <path>] --json
431
+ Preferred: dd-flow dashboard render --project <project>
432
+ dd-flow dashboard data --global --json
433
+ Preferred: dd-flow dashboard data
434
+
435
+ Project accepts full id, short id, slug, or registered project root path.
436
+
437
+ Related dashboard commands:
438
+ dd-flow dashboard open
439
+ dd-flow dashboard refresh
440
+ dd-flow dashboard refresh --all
441
+ dd-flow dashboard open --project <project>
442
+ dd-flow dashboard data --project <project> --json
345
443
 
346
- Dashboards are rendered views of dd-flow state. Markdown remains the compatibility fallback. HTML dashboards write JSON next to self-contained local HTML: global under DD_FLOW_HOME/dashboard/ and project/protocol pages under DD_FLOW_HOME/projects/<PRJ-ID-slug>/dashboard/. State-changing commands still auto-refresh markdown during the transition. cmux is used only by explicit open/refresh commands and only according to project config.`
444
+ Dashboards are rendered views of dd-flow state. Markdown remains the compatibility fallback. HTML dashboards write JSON next to self-contained local HTML: global under DD_FLOW_HOME/dashboard/ and project/protocol pages under DD_FLOW_HOME/projects/<PRJ-ID-slug>/dashboard/. Dashboard JSON uses lifecycle/resource/claim fields as the primary contract when present; current_stage/raw_stage/raw_status/merge_queue/job are compatibility or diagnostic fields. Global dashboard data consumes published project summaries, exposes supported_summary_versions and summary_version_groups, and lists missing/unreadable/unsupported project summaries under unsupported_projects instead of silently hiding those projects. State-changing commands still auto-refresh markdown during the transition. cmux is used only by explicit open/refresh commands and only according to project config. JSON mode writes machine-readable output only.`
347
445
  ],
348
446
  [
349
447
  "schema",